By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Setting Query Parameters Through VB

P: 2
Hi,
I have 10 queries linked together via an incident number. There is a form where the user enters start and end dates to define which incident numbers are used within the queries. On running this form a query is created (UserQuery) which consequently sets the dates (as entered by the user) for all the other queries.

I have made a new form which runs a different query but still relies on the UserQuery to set the dates. currently the user has to manually open deisgn view of UserQuery and change the date parameters before running my form. My problem is this; how can i make it so that these date parameters are changed simply by typing them in on my form? I know VB allows you to write a query within the code but i dont need a new query, i just need to change the one which already exists. Is there visual basic code to set parameters of an already-made query?

Any help would be greatly appreciated, I've been puzzling over this for ages!

Thanks.
Oct 12 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 143
In the criteria of the date field in your query, refer to the form on which the user enters the dates.

Between [forms]![frmYourFormName]![txtTextBoxName] And [forms]![frmYourFormName]![txtTextBoxName]
Oct 12 '06 #2

P: 2
Tanis you're a legend, thanks.
Oct 12 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.