J
Jan T.
I have a form "Period" with two text boxes. One for startDate
and one for EndDate. I want to use that form to limit the query
for my Report by the dates. However, when I refer to the
Form it does not seem to understand it is a date? I use the following
statement in my query:
SELECT Opphold.CheckIn
FROM Opphold
WHERE (((Opphold.CheckIn)<=[Forms]![Perioder].[txtStartDate]));
I also tried to convert it to a date like the following:
CDate(<=[Forms]![Perioder].[txtStartDate]))) but that did not work?
What should I do in order to the query to read the condition or dates from
my forms?
(The only thing I CAN get to work is if I make a function in vba that return
the value or date from the form and refering to the function in my Report
query:
Function startingDate(myStart as Date) as Date
startingDate = Forms("Period").txtStartDate
End Function)
Appreciate your answer.
Regards
Jan T.
and one for EndDate. I want to use that form to limit the query
for my Report by the dates. However, when I refer to the
Form it does not seem to understand it is a date? I use the following
statement in my query:
SELECT Opphold.CheckIn
FROM Opphold
WHERE (((Opphold.CheckIn)<=[Forms]![Perioder].[txtStartDate]));
I also tried to convert it to a date like the following:
CDate(<=[Forms]![Perioder].[txtStartDate]))) but that did not work?
What should I do in order to the query to read the condition or dates from
my forms?
(The only thing I CAN get to work is if I make a function in vba that return
the value or date from the form and refering to the function in my Report
query:
Function startingDate(myStart as Date) as Date
startingDate = Forms("Period").txtStartDate
End Function)
Appreciate your answer.
Regards
Jan T.