DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   getting condtional report on the basis of field (http://www.daniweb.com/forums/thread167252.html)

firoz ahmed Jan 9th, 2009 11:45 am
getting condtional report on the basis of field
 
1 Attachment(s)
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
Private Sub Command4_Click()
  Dim mr As Integer
  mr = InputBox("enter a mr no")
  Set rs = New ADODB.Recordset
  rs.Open "select * from MR  where req_no = " & CStr(mr), con, adOpenDynamic, adLockOptimistic
If Not rs.EOF Then
With DataReport2.Sections("section1").Controls
  .Item("text1").DataField = rs.Fields("productname").Name
  .Item("text2").DataField = rs.Fields("qty").Name
  .Item("text3").DataField = rs.Fields("unit").Name
  .Item("text4").DataField = rs.Fields("dept_name").Name
  .Item("text5").DataField = rs.Fields("job_no").Name
  .Item("text6").DataField = rs.Fields("cost_centre").Name
  .Item("Text7").DataField = rs.Fields("Emp_name").Name
  .Item("text8").DataField = rs.Fields("mr_date").Name
  .Item("text9").DataField = rs.Fields("del_point").Name
  .Item("TEXT10").DataField = rs.Fields("MANAGER").Name
  .Item("TEXT11").DataField = rs.Fields("REQ_NO").Name
  End With
  Set DataReport2.DataSource = rs
  DataReport2.Orientation = rptOrientLandscape
  DataReport2.Refresh
  DataReport2.Show vbModeless
End If
End Sub[ATTACH]8800


All times are GMT -4. The time now is 1:56 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC