B
Bobk
I have a form used to input data for order entry. When the data is entered I
have a button that displays a report with the data on the order entry form.
The report serves as an order acknowledgement. When I click on the button I
get the error message "Data type mismatch in criteria expression". The code I
am using in the form is:
Private Sub Command188_Click()
On Error GoTo Err_Command188_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "OEack-rpt", acViewPreview, , "[oeheader_oejobnumber]="
& [oejobnumber]
Exit_Command188_Click:
Exit Sub
Err_Command188_Click:
MsgBox Err.Description
Resume Exit_Command188_Click
End Sub
The report has this code for a filter:
([oeheader_oejobnumber]= [oejobnumber])
And the query has this code:
oeheader_oejobnumber: oejobnumber
The key, oejobnumber is text.
I have also tried this code in the form:
stDocName = "OEack-rpt"
DoCmd.OpenReport stDocName, acPreview
- And without the added code for the filter in the report and the code in
the query. This works except it only displays data from the first record in
the order entry file and not data being displayed on the current form.
What am I doing wrong?
have a button that displays a report with the data on the order entry form.
The report serves as an order acknowledgement. When I click on the button I
get the error message "Data type mismatch in criteria expression". The code I
am using in the form is:
Private Sub Command188_Click()
On Error GoTo Err_Command188_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "OEack-rpt", acViewPreview, , "[oeheader_oejobnumber]="
& [oejobnumber]
Exit_Command188_Click:
Exit Sub
Err_Command188_Click:
MsgBox Err.Description
Resume Exit_Command188_Click
End Sub
The report has this code for a filter:
([oeheader_oejobnumber]= [oejobnumber])
And the query has this code:
oeheader_oejobnumber: oejobnumber
The key, oejobnumber is text.
I have also tried this code in the form:
stDocName = "OEack-rpt"
DoCmd.OpenReport stDocName, acPreview
- And without the added code for the filter in the report and the code in
the query. This works except it only displays data from the first record in
the order entry file and not data being displayed on the current form.
What am I doing wrong?