Parameter Query Using Calendar Control

  • Thread starter More Questions than Answers
  • Start date
M

More Questions than Answers

Hello;

I have been trying to design a query in an access project by creating a form
to take in start and end dates for a field through calendar controls. In the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
T

Tom Ellison

Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
[email protected]> wrote in message
news:[email protected]...
 
M

More Questions than Answers

Now it's giving me "Invalid or missing expression." Below is the revised
statement. do I have my quotes in the wrong places?

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"

Thanks in advance for the help!

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
[email protected]> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls. In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
M

More Questions than Answers

I see, too, that I had an extra ' on the end of the statement, which I took
out.

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
[email protected]> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls. In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and "#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
T

Tom Ellison

Dear More:

The values in the referenced controls must be set. Are they? Check the
references to see they are correct. Correct form and column names, that is.

Tom Ellison


"More Questions than Answers"
Now it's giving me "Invalid or missing expression." Below is the revised
statement. do I have my quotes in the wrong places?

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"

Thanks in advance for the help!

Tom Ellison said:
Dear More:

I think I see it:

BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "# AND #" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

You need the AND in the finished string!

Tom Ellison


"More Questions than Answers" <More Questions than
[email protected]> wrote in message
Hello;

I have been trying to design a query in an access project by creating a
form
to take in start and end dates for a field through calendar controls.
In
the
criteria for the date field I have put:

'BETWEEN "#" & [FORMS]![Discharge Date Range]![StartDate] & "#" and
"#" &
[FORMS]![Discharge Date Range]![EndDate] & "#"'

I am getting this error when I do this:

'Data type error in expression.'

What am I doing wrong?
 
Top