Parameters query

P

piku

Hi,

I have 2 forms and query. The query contain fields and 2 field have
criteria(Forms!Form1!NameControl).
I want to use with this query by the second form so i put in the criteria
Forms!Form1!NameControl or Forms!Form2!NameControl.
when i call the query from the second form it's good but if i call the query
from the first form he show MsgBoxParametr to insert the value.
how i can to use with one query in 2 forms and will not show the
MsgBoxParameter?

ThankU!!!
 
K

Ken Snell

What you want to do is not what I would consider good database design. Just
make two separate queries, one for each form.

(To do what you want, you'd need to write a VBA function that tests to see
which form is open and then to return the value of that form's control. Of
course, what if they're both open? Seems overly complicated to me for what
you want to do.)

If you want to keep the same query structure for both form, make one query
to return all the records, then make two additional queries, one for each
form, where each query uses the first query as the table and then filters
based on one form's control's value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top