M
MDW
I've have a report based on a select query that either returns 1 'record' or
more than 1 'record'. I want to only see the first record. The record is
called using the following code (on click event) from a form
Private Sub summary_report_Click()
On Error GoTo Err_summary_report_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Report1"
stLinkCriteria = "[rec_number]=" & "'" & Me![rec_Number] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Exit_summary_report_Click:
Exit Sub
Err_summary_report_Click:
MsgBox Err.Description
Resume Exit_summary_report_Click
End Sub
Can I amend the code, or do I have to amend the underlying select query (
containing multiple linked tables with a mixture of 1 to 1 and 1 to many
links - hence the more than one results ?)
more than 1 'record'. I want to only see the first record. The record is
called using the following code (on click event) from a form
Private Sub summary_report_Click()
On Error GoTo Err_summary_report_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Report1"
stLinkCriteria = "[rec_number]=" & "'" & Me![rec_Number] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Exit_summary_report_Click:
Exit Sub
Err_summary_report_Click:
MsgBox Err.Description
Resume Exit_summary_report_Click
End Sub
Can I amend the code, or do I have to amend the underlying select query (
containing multiple linked tables with a mixture of 1 to 1 and 1 to many
links - hence the more than one results ?)