View Full Version : variables and forms


neilp
10-23-2001, 09:55 AM
I have created a macro containing several queries which require the start and end dates to be imput for each query.
I believe there is a way of creating an unbound control on a form that can accept the two variables and pass them to the macro thus preventing the need for repeated user input.
Can some kind person put me out of my misery and lead me towards the answer.
Thanks in anticipation.

paulmcdonnell
10-23-2001, 10:04 AM
If I'm following this correctly...

1) Create a form (say [Myform]) with unbound fields START and END dates as name of the controls
2) Set your query parameters for START and END date to refer to this forms controls i.e

In the Criteria cell = Forms![Myform].start
for the start date and FOrms![Myform],end for end date

OR

Between Forms![myform].start AND Forms![myform].end

if your date has to lie between the two dates on your form.

Hope this helps

paul

neilp
10-25-2001, 02:04 AM
Paul or anyone who can help

I have managed to follow your directions and the query is working in that no error messages are produced but it does not seem to accept the data entered in the fields 'start' and 'end' on the form.

If the query is run on its own and the dates entered as prompted it works fine, there is something that is not allowing the query to accept the data from the form correctly.

Help please