queries and parm

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

Guest

I have a form that has a cmd button when pressed it request a parm and than
run a union query and displays the results in a subform on the main form. The
problem is that when I first open the main form it always wants the parm
entered. if I say OK and leave the parm empty the form opens correctly if I
give it a value it opens correctly. I don't want to do either when I open the
main form. the button is for a search query and does not need to run unless I
request it after I open the main form. How can I stop this from requesting
the parm at the open for the main form.
 
How would I go about adding this "null"? I have tried several different
things but keep getting a syn tech error.
 
I assume in each query that makes up the union you have something in the
criteria box. In the same line add "or is null" and the union should retrieve
no records. This is an educated guess.
 
It is not the results of the query that I am having the problem it is the
fact that when I open the main form it wants to run the query in the first
place. I don't want it to run the query until I am ready to run it. Does this
make since?
 
It does make sense, but if you base a form on a query that has a criteria
attached to it then it will ask you for the parameter when the form is
opened.

I don't know whether changing the options on the "Data tab" of the form
control may do anything.
 
Is there a better way to do this? When the form opens I do not want to have
any parm requested but if I press the cmd button on the form I want it to ask
for a parm and then run the query. is this possible?
 
The only other way to do it is to set the criteria in the query to an
unbound text box in another form and have a command button that will open the
records once you have selected the parameter.
 
Back
Top