Running a query from a form

P

Petterq

I have made a command button in a form, that shows a rebort based on a query.

The query asks for a customerID. The customerID is shown in the form window.
How can i make the command button put the current customerID into the query?
 
R

Rick Brandt

Petterq said:
I have made a command button in a form, that shows a rebort based on
a query.

The query asks for a customerID. The customerID is shown in the form
window. How can i make the command button put the current customerID
into the query?

Where your query now has a self-prompting parameter (something like [Enter
Customer ID]), replace that with a reference to your form.

Forms!FormName!customerID
 
B

bymarce

I used [Forms]![Search Form]![MLO #] in my query to refer to my form and it
worked for exact matches. The MLO # is in the form ####-####. Is there a
way to use wild cards on the form? I've tried typing an expression on the
form as I would on the query, such as >####-####. I also have a column for
desciption refered to as [Forms]![Search Form]![Description] in my search.
For this column we usually search with * because the search criteria is
usually part of the field. In the form I tried using *criteria* and it
didn't return anything. Also in the query I tried putting *[Forms]![Search
Form]![Description]* and access changes it to Like "*[Forms]![Search
Form]![Description]*". Thanks for the help.
ByMarcie

Rick Brandt said:
Petterq said:
I have made a command button in a form, that shows a rebort based on
a query.

The query asks for a customerID. The customerID is shown in the form
window. How can i make the command button put the current customerID
into the query?

Where your query now has a self-prompting parameter (something like [Enter
Customer ID]), replace that with a reference to your form.

Forms!FormName!customerID
 
Top