I believe that i need to tweak a query criteria for a report.
I am trying to select a customerID (cusID) as the basis for the report.
I have a couple of subforms on a form.
The first subform has the CusID and minor data in it.
I wanted to arrow or mouse to the subform for a desired customer.
Then look at various pieces of data.
I wanted to avoid having to do a pull down for the Report Button.
I want to hit a Button that i have on the form,
to go to Print Preview for the desired customer that is shown in the first subform.
The form button has an On Click event that refers to a report. I shortened it up for here.
Private Sub cmd4245_Click()
On Error GoTo Err_cmd4245_Click
Dim stDocName As String
stDocName = "rpt4245Main"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
Exit_cmd4245_Click:
Exit Sub
Err_cmd4245_Click:
MsgBox Err.Description
Resume Exit_cmd4245_Click
End Sub
-----------------
The rpt4245Main uses a query Qry4234SpringBuyCustomerAddress to use for the report letter
for the selected customer.
Inside this Qry, in the CusID field, I have a criteria as such:
[Forms]![frm4200SprintBuy]![sfrm4243Customer]![CusID]
When I hit the form button, i get the above. If i manually answer a correct CusID,
the query and report continue on correctly anyway.
The query is ignoring the info above criteria string and accepting my manual CusID input.
I hope that i explained this ok.
Thanks much.
The report in turn is based on a query
I am trying to select a customerID (cusID) as the basis for the report.
I have a couple of subforms on a form.
The first subform has the CusID and minor data in it.
I wanted to arrow or mouse to the subform for a desired customer.
Then look at various pieces of data.
I wanted to avoid having to do a pull down for the Report Button.
I want to hit a Button that i have on the form,
to go to Print Preview for the desired customer that is shown in the first subform.
The form button has an On Click event that refers to a report. I shortened it up for here.
Private Sub cmd4245_Click()
On Error GoTo Err_cmd4245_Click
Dim stDocName As String
stDocName = "rpt4245Main"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
Exit_cmd4245_Click:
Exit Sub
Err_cmd4245_Click:
MsgBox Err.Description
Resume Exit_cmd4245_Click
End Sub
-----------------
The rpt4245Main uses a query Qry4234SpringBuyCustomerAddress to use for the report letter
for the selected customer.
Inside this Qry, in the CusID field, I have a criteria as such:
[Forms]![frm4200SprintBuy]![sfrm4243Customer]![CusID]
When I hit the form button, i get the above. If i manually answer a correct CusID,
the query and report continue on correctly anyway.
The query is ignoring the info above criteria string and accepting my manual CusID input.
I hope that i explained this ok.
Thanks much.
The report in turn is based on a query