A
AKA Sparkticus
DoCmd.OpenReport "Contractors_Invoice", acPreview, "[Invoice
Query].[InvoviceID]=" & Me![InvoviceID]
I am trying to preview a report based on the invoviceID( yeah I know itspelt
wrong) the report in based on a Invoice query
what I am trying to do is pass the value of the invoviceID so as not have
the need to type it in..
the query does the filtering
here is the code I have
at the moment the query still asks for the invoviceID any idea what I need
to change to pass this data
many thanx for any help
complete code
Private Sub Command33_Click()
On Error GoTo Err_Preview_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If IsNull(Me![InvoviceID]) Then
MsgBox "Enter purchase order information before previewing."
Else
DoCmd.OpenReport "Contractors_Invoice", acPreview, "[Invoice
Query].[InvoviceID]=" & Me![InvoviceID]
End If
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
If Err <> 2501 Then
MsgBox Err.Description
End If
Resume Exit_Preview_Click
End Sub
Query].[InvoviceID]=" & Me![InvoviceID]
I am trying to preview a report based on the invoviceID( yeah I know itspelt
wrong) the report in based on a Invoice query
what I am trying to do is pass the value of the invoviceID so as not have
the need to type it in..
the query does the filtering
here is the code I have
at the moment the query still asks for the invoviceID any idea what I need
to change to pass this data
many thanx for any help
complete code
Private Sub Command33_Click()
On Error GoTo Err_Preview_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If IsNull(Me![InvoviceID]) Then
MsgBox "Enter purchase order information before previewing."
Else
DoCmd.OpenReport "Contractors_Invoice", acPreview, "[Invoice
Query].[InvoviceID]=" & Me![InvoviceID]
End If
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
If Err <> 2501 Then
MsgBox Err.Description
End If
Resume Exit_Preview_Click
End Sub