Why won't my parameter query use the form I created to pass values

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

Guest

I've created a form called Last Month with a single Combo Box named Month so
that I can pass a month value chosen from a list to a query. The query
criterion is [Forms]![Last Month]![Month] but when the query is run the query
does not go to the form with the list. It just asks for a value for
Forms]![Last Month]![Month] to be entered.

I've compared the properties of this combo box to others on forms which do
work but I can't see any difference. I've tried to do this with other combo
boxes with different types of data for other query fields but I can't get any
query to accept parameters from a form. Am I overlooking something obvious?

I'm running Access 2003 on a database in Access 2000 format.

Richard Bancroft
 
I've created a form called Last Month with a single Combo Box named Month so
that I can pass a month value chosen from a list to a query. The query
criterion is [Forms]![Last Month]![Month] but when the query is run the query
does not go to the form with the list. It just asks for a value for
Forms]![Last Month]![Month] to be entered.

I've compared the properties of this combo box to others on forms which do
work but I can't see any difference. I've tried to do this with other combo
boxes with different types of data for other query fields but I can't get any
query to accept parameters from a form. Am I overlooking something obvious?

I'm running Access 2003 on a database in Access 2000 format.

Richard Bancroft

1) The form must still be open when the query is run.

2) "Month" is the name of a VBA Function and it (like Date, Name,
Year, etc.) should not be used as a field or control name. Access gets
confused. Change the name of the control to something else, i.e.
txtMonth. Make sure the datatype of the field in the query is the same
as the datatype entered in the form.
 
Back
Top