Parameter Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a parameter query that I want to use as the datasource for a text box on a form. The parameter Data will come from another text box on the same form. Can anybody tell me how I can pass this parameter information to the query (using the expression builder) to get the required info from the query
 
In the Where clause of the query just refer directly to the textbox on the
form.

In the Query Builder, use the Criteria field under the appropriate column
and put the following:

=forms!MyForm!MyTextbox

Replace 'MyForm' with your form name and 'MyTextBox' with the name of the
textbox that contains the value you want to use in the condition.

FWIW, since textboxes don't have datasources (the controlsource for a
textbox is either a field or an expression) I assume that you are actually
talking about a query that is used as the RowSource for a combo or listbox.
For this to work you also need to Requery the combo or listbox whenever the
related textbox changes. Use the AfterUpdate event of the textbox control to
requery the control that is based on this query.
 
Back
Top