Hi all!
I've got a form that depends on a query having the following two parameters:
month, year (integer).
If the user opens the form from the main access window, he has to enter both parameters before the form opens, and this is intendedly so.
However in some circumstances I'd like the user to open the form out of a "welcome form", where month and year are already given in text boxes. Then the user shall not be prompted to enter values for month and year again.
The queries that the forms depend on all have the form
SELECT something FROM sometable
WHERE DatePart("m";MyDate) = [month?] AND
DatePart("yyyy";MyDate) = [year?];
I know that I could let the form depend on such a query:
SELECT something FROM sometable
WHERE DatePart("m";MyDate) = [WelcomeForm.txtMonth.Value]
AND DatePart("yyyy";MyDate) = [WelcomeForm.txtYear.Value];
but then it's not possible any more to open the form from the main access window and entering the parameters by hand.
So what can I do to set the parameters [month?] and [year?] programmatically?
Thanks a lot,
Anne
I've got a form that depends on a query having the following two parameters:
month, year (integer).
If the user opens the form from the main access window, he has to enter both parameters before the form opens, and this is intendedly so.
However in some circumstances I'd like the user to open the form out of a "welcome form", where month and year are already given in text boxes. Then the user shall not be prompted to enter values for month and year again.
The queries that the forms depend on all have the form
SELECT something FROM sometable
WHERE DatePart("m";MyDate) = [month?] AND
DatePart("yyyy";MyDate) = [year?];
I know that I could let the form depend on such a query:
SELECT something FROM sometable
WHERE DatePart("m";MyDate) = [WelcomeForm.txtMonth.Value]
AND DatePart("yyyy";MyDate) = [WelcomeForm.txtYear.Value];
but then it's not possible any more to open the form from the main access window and entering the parameters by hand.
So what can I do to set the parameters [month?] and [year?] programmatically?
Thanks a lot,
Anne