how do I create query that receives user input from a form?

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

Guest

I want to prompt the user, via a form, to enter criteria used by a query to
return the desired data set.
 
might be better to have a text box on the form to enter
the data.
then in your query as criteria...
[forms]![yourform]![yourtextbox]
in the form you can hassel the user like this in the
before update event...
if isnull(me.textbox)then
msgbox("enter something in the textbox")
exit sub
end if
the exit sub part will keep dumping them out of the code
until they enter something in the text box.
 
Thank you very much for the response!! Question - the form has 2 test boxes
prompting the user for 2 seperate enteries (Name, Date). I want where let's
say the name text box is left blank, the query to return all names for the
date that was entered.

might be better to have a text box on the form to enter
the data.
then in your query as criteria...
[forms]![yourform]![yourtextbox]
in the form you can hassel the user like this in the
before update event...
if isnull(me.textbox)then
msgbox("enter something in the textbox")
exit sub
end if
the exit sub part will keep dumping them out of the code
until they enter something in the text box.
-----Original Message-----
I want to prompt the user, via a form, to enter criteria used by a query to
return the desired data set.
.
 
Look to the following: http://www.fontstuff.com/access/index.htm and go to
the article "Customizing Access Parameter Queries" it will walk you through
it.

Vincent Summers said:
Thank you very much for the response!! Question - the form has 2 test boxes
prompting the user for 2 seperate enteries (Name, Date). I want where let's
say the name text box is left blank, the query to return all names for the
date that was entered.

might be better to have a text box on the form to enter
the data.
then in your query as criteria...
[forms]![yourform]![yourtextbox]
in the form you can hassel the user like this in the
before update event...
if isnull(me.textbox)then
msgbox("enter something in the textbox")
exit sub
end if
the exit sub part will keep dumping them out of the code
until they enter something in the text box.
-----Original Message-----
I want to prompt the user, via a form, to enter criteria used by a query to
return the desired data set.
.
 
Back
Top