Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expressions in query field to filter data

Status
Not open for further replies.

Llandeilo

Technical User
Mar 24, 2003
3
0
0
GB
We are using access 2000 as an intermediary between systems where data is imported, filtered and then exported. We are having no problems with the importing and exporting however the filter will not work.

To filter the data (by 'centre number') in the query we have tried use a combo box or a text box in a form as this provides a more user-friendly interface.

We designed a form with a combo box and a command button which ran a macro for exporting data from the query.

The combo box takes its information from a grouping of 'centre numbers'.

In the query in the 'centre number' field we wish to filter by we have used the expression type:
=[forms]![formname]![comboboxname]
We then select in the 'centre number' we wish to filter for using a the combo box in the form. When we select of command button or when we try to open the query it still asks us to specify the parametre value for the expression. It will only filter the data once we have entred it at this stage.

We also tried the same system using a text box in a form and the expression
=[forms]![formname]![textboxname]

Do you know where we have gone wrong? I assume that the expression is not correctly linking the query to the combo box or text box.

Thanks

 
The syntax you are using is correct. Is this in the criteria row for the query?

Just a few things to check:

Is the combobox unbound?
Are you referencing the actual name of the combobox ie the name listed under 'Other' in the Name box.
Is the form 'Active' when you run the query?
Have you typed the combobox and formnames exactly as they are in the form eg. same spellings, including spaces etc.

If this doesn't help then please post the name of your form, name of your combobox and the actual code from your query.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top