If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Parameters query
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!!! |
#2
|
|||
|
|||
Parameters query
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. -- Ken Snell http://www.accessmvp.com/KDSnell/ "piku" wrote in message news 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!!! |
Thread Tools | |
Display Modes | |
|
|