A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameters query



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2010, 07:19 AM posted to microsoft.public.access.queries
piku
external usenet poster
 
Posts: 8
Default 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  
Old April 11th, 2010, 01:07 PM posted to microsoft.public.access.queries
Ken Snell
external usenet poster
 
Posts: 177
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.