Passing a Parameter issue (1 Viewer)

chrisjames25

Registered User.
Local time
Today, 10:46
Joined
Dec 1, 2014
Messages
401
Hi

I created a Frm_InvoiceMain form and a Frm_Subinvoice form. When i created a qry to filter a lstbox for the subform it worked perfectly until i opened it as a subform within the mainform.

Query design is attached. As is the message i get when i open the mainform.

Not sure how to amend the query design to take into account that it is now a subform.
 

Attachments

  • Qry Design.JPG
    Qry Design.JPG
    89.2 KB · Views: 35
  • Parameter message.JPG
    Parameter message.JPG
    17.7 KB · Views: 28

chrisjames25

Registered User.
Local time
Today, 10:46
Joined
Dec 1, 2014
Messages
401
thanks for link. Had found a similar loink but still not sure how that means i amend mine qry design. From the criteria being Like "*" & [Forms]![Frm_SubInvoiceDetails]![Txt_SrchText] & "*"

Any ideas
 

isladogs

MVP / VIP
Local time
Today, 10:46
Joined
Jan 14, 2017
Messages
18,209
Syntax is Forms!YourFormName.ControlNameOfYourSubform.Form.ControlNameInSubform

Try this:

Like "*" & [Forms]![Frm_InvoiceMain form].[Frm_SubInvoiceDetails].Form.[Txt_SrchText] & "*"

NOTE: this assumes Frm_SubInvoiceDetails is the name of the subform control
 

chrisjames25

Registered User.
Local time
Today, 10:46
Joined
Dec 1, 2014
Messages
401
GOt it

The solution was i am a plonker and wasnt referring ot the child form by the actual form i inserted into the child form.

Code:
Like "*" & [Forms]![Frm_InvoiceMain]![Frm_ChildInvoiceForm].[Form]![Txt_SrchText] & "*"
 

isladogs

MVP / VIP
Local time
Today, 10:46
Joined
Jan 14, 2017
Messages
18,209
Excellent. Its usually the control name of the subform that's the issue!
 

Users who are viewing this thread

Top Bottom