Is this possible?

smask

Registered User.
Local time
Today, 13:01
Joined
Jan 9, 2003
Messages
21
Hi!

Can I have a form (datum) that transmits the criteria to a query?


Like the Form gives me [tre] and [fyra]

In the criteria field in the query:

Between #Forms![Datum]![tre]# And #Forms![Datum]![fyra]#

/ Smask
 
Yes, you can, with the following limitations:

The form Datum must be open in form view when the query runs, or you'll get an error.

You would not use the pound signs (#) in this context. They are only used to indicate a date value when the date is specified as a literal (e.g., #2/3/03# instead of just plain 2/3/03 or "2/3/03"). Here, you're not using literals but references to controls on a form - if the contents of those controls are to be interpreted as dates, then use the following syntax:

Between DateValue(Forms![Datum]![tre]) And DateValue(Forms![Datum]![fyra])
 

Users who are viewing this thread

Back
Top Bottom