Form/Query Problem

L

Lisa

In my subform 'Orders Special Products Details Extended subform' I have

a command button named 'cmdPrintSpecialOrderGiftReceipt' to bring up a
report preview. There is a query to fliter the report called
'qrySpecialOrdersGiftReportFilter'. When I use the button I get a ENTER

PARAMETER VALUE message box.


The code I used for the command button is:


Private Sub cmdPrintSpecialOrderGiftReceipt_Click()
On Error GoTo Err_cmdPrintSpecialOrderGiftReceipt_Click


Dim stDocName As String


stDocName = "Special Orders Gift Report"
DoCmd.OpenReport stDocName, acViewPreview,
"qrySpecialOrdersGiftReportFilter"


Exit_cmdPrintSpecialOrderGiftReceipt_Click:
Exit Sub


Err_cmdPrintSpecialOrderGiftReceipt_Click:
MsgBox Err.Description
Resume Exit_cmdPrintSpecialOrderGiftReceipt_Click


End Sub


For the query I used:
Field: qrySpecialOrdersGiftReport.*
Table:qrySpecialOrdersGiftReport
Show: Yes


Field: SpecialOrderID
Table: qrySpecialOrdersGiftReport
Show: No
Criteria: [Forms]![Orders Special Products Details Extended
subform]![SpecialOrderID]


Can anyone offer assistance in detecting where my error is? Thank you
for the support


If I can ever get it working right I will change to acViewNormal
instead of preview.
 
G

Guest

The problem is you need to identify the main form in your criteria.
Criteria: [Forms]![MyMainFormNameGoesHere]![Orders Special Products Details
Extended subform]![SpecialOrderID]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top