getting condtional report on the basis of field

Reply

Join Date: Dec 2008
Posts: 5
Reputation: firoz ahmed is an unknown quantity at this point 
Solved Threads: 0
firoz ahmed firoz ahmed is offline Offline
Newbie Poster

getting condtional report on the basis of field

 
0
  #1
Jan 9th, 2009
sir
i want if user click on product id all the detail should come on the data report it should come itemwise all the required field is com.
but problem is that all the records is comming more that one time
kindly help me i have written a code in command1_click it is working fine but need is that when user put item code in form those records which is similar it should come group wise here is the
When report is comming department , cost centre, Cost Centre manager(fields) ,requested by ..
are comming two times why according to Iso certified report it should come one time here is the code.

code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command4_Click()
  2. Dim mr As Integer
  3. mr = InputBox("enter a mr no")
  4. Set rs = New ADODB.Recordset
  5. rs.Open "select * from MR where req_no = " & CStr(mr), con, adOpenDynamic, adLockOptimistic
  6. If Not rs.EOF Then
  7. With DataReport2.Sections("section1").Controls
  8. .Item("text1").DataField = rs.Fields("productname").Name
  9. .Item("text2").DataField = rs.Fields("qty").Name
  10. .Item("text3").DataField = rs.Fields("unit").Name
  11. .Item("text4").DataField = rs.Fields("dept_name").Name
  12. .Item("text5").DataField = rs.Fields("job_no").Name
  13. .Item("text6").DataField = rs.Fields("cost_centre").Name
  14. .Item("Text7").DataField = rs.Fields("Emp_name").Name
  15. .Item("text8").DataField = rs.Fields("mr_date").Name
  16. .Item("text9").DataField = rs.Fields("del_point").Name
  17. .Item("TEXT10").DataField = rs.Fields("MANAGER").Name
  18. .Item("TEXT11").DataField = rs.Fields("REQ_NO").Name
  19. End With
  20. Set DataReport2.DataSource = rs
  21. DataReport2.Orientation = rptOrientLandscape
  22. DataReport2.Refresh
  23. DataReport2.Show vbModeless
  24. End If
  25. End Sub[ATTACH]8800
Last edited by Ancient Dragon; Jan 9th, 2009 at 7:22 pm. Reason: add code tags
Attached Files
File Type: zip MR.zip (269.6 KB, 0 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC