![]() |
| ||
| Re: Retrieving query records on datareport Private Sub Command4_Click() Set rs = New adodb.Recordset rs.Open " select * from MR query", con, adOpenKeyset, adLockPessimistic If rs.RecordCount > 0 Then If Not rs.EOF Then With DataReport2.Sections("section1").Controls .Item("text1").DataField = rs.Fields("dept_name").Name End With Set DataReport2.DataSource = rs DataReport2.Show End If End If End Sub try to erase this DataReport2.Orientation = rptOrientLandscape and change this adOpenDynamic, adLockOptimistic to this adOpenKeyset, adLockPessimistic regards Ryan Riel |
| ||
| Re: Retrieving query records on datareport now it is working but requirement is that when user click on print inputbox should come to demand MR NO if it match with mr_no of database then corresponding record should come in a report kindly help me Private Sub Command4_Click() Set rs = New adodb.Recordset rs.Open " select * from MR query", con, adOpenDynamic, adLockOptimistic If Not rs.EOF Then With DataReport2.Sections("section1").Controls .Item("text1").DataField = rs.Fields("dept_name").Name .Item("text2").DataField = rs.Fields("job_no").Name End With Set DataReport2.DataSource = rs DataReport2.Orientation = rptOrientLandscape DataReport2.Show End If End Sub |
| ||
| Re: Retrieving query records on datareport try to put a where in rs.open select * from mr query where mr no = mr_no regards Ryan Riel |
| ||
| Re: Retrieving query records on datareport please mark it solved, if the thread is solved thanks :) |
| ||
| Re: Retrieving query records on datareport i have tried but it is not working kindly let me know Private Sub Command4_Click() Dim mr As Integer mr = InputBox("enter a mr no") Set rs = New adodb.Recordset rs.Open " select * from MR query where mr = mr_no", con, adOpenDynamic, adLockOptimistic If Not rs.EOF Then With DataReport2.Sections("section1").Controls .Item("text1").DataField = rs.Fields("dept_name").Name .Item("text2").DataField = rs.Fields("job_no").Name End With Set DataReport2.DataSource = rs DataReport2.Orientation = rptOrientLandscape DataReport2.Show End If End Sub |
| ||
| Re: Retrieving query records on datareport Dim mr As Integer mr = InputBox("enter a mr no:", "Find", "") Set rs = New adodb.Recordset rs.CursorLocation = adUseClient rs.Open " select * from MR query where mr_no = mr", con, adOpenDynamic, adLockOptimistic If Not rs.EOF Then With DataReport2.Sections("section1").Controls .Item("text1").DataField = rs.Fields("dept_name").Name .Item("text2").DataField = rs.Fields("job_no").Name End With Set DataReport2.DataSource = rs DataReport2.Orientation = rptOrientLandscape DataReport2.Show End If |
| All times are GMT -4. The time now is 4:06 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC