Format Problem

G

Guest

Hello, I have a Date/Time field formatted in a query like so:

Format([DateTime], "Short Date")

When I put #5/23/2006# into the criteria field, it works fine. However when
I try to link this query to a form using: [Forms]![Daily Call Center
Reports]![FromDate] In the criteria field.....I get the error: "The Microsoft
Jet database engine does not recognize '[Forms]![Daily Call Center
reports]![FromDate] as a valid field name or expression."

I tried adding # signs before the form call, but that gives me the error:
"The expression you entered has an invalid date value" message before I can
move off of the criteria box.

Can someone please help?! Thanks!

Nick
 
J

John Spencer

Sounds as if you might be using a crosstab query. If so, you must declare your
parameters in the query.

If you are in the query grid
-- Right-Click on the grey area and select Parameters.
-- Enter your pareameter exactly and then select the datetime type.

In SQL that would look something like:

Parameters [Forms]![Daily Call Center reports]![FromDate], DateTime;
.... The rest of your existing query

Watch out Access has a nasty habit of adding an extra set of [] around the
entire parameter and then complaining about the extra brackets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top