Passing textbox data in a query

  • Thread starter Thread starter kraasty
  • Start date Start date
K

kraasty

Sorry if this post will appear twice, (the first one didn?t make it )


Hello all

When i doubleclick a textbox in a form (in datasheet view) there is macro
that opens a query with the criteria:
Like forms!myform!txtbox1
In this case the query shows only specific record i clicked on

But when I put this form as a subform to another form & doubleclick on the
textbox
the query shows nothing
Can anyone suggest something? thanks
 
When you use a form as a subform in another form, that 'now' subform no
longer is "open" on its own, and references such as the one you're using
won't work as written. Instead, the 'now' subform is a child of the form in
which it's being used as a subform. The correct reference to it now is

Forms!MainForm!SubformName!ControlOnSubform

Note that "SubformName" is the name of the subform control (the control that
holds the subform, which may or may not have the same name as the form that
is serving as the Source Object of that control).
 
The reference to the TextBox (in the Query) needs to be changed to:

Forms!MainForm!SubformCONTROL.Form!TextBox1

You need to check the name of the SubformCONTROL in the design view of the
MainForm. It may or may not be "MyForm" as per your reference.
 
Thank you very much Ken and Van for your help.
I corrected the reference to the control and now it works fine!
 
Thank you very much Ken and Van for your help.
I corrected the reference to the control and now it works fine!
 

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

Back
Top