Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

"Expression is typed incorrectly or is too complex..."

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J. Trucking - 21 May 2007 07:01 GMT
Hello,

I have a form which is linked to a query/report.  The general idea is
that the user can fill out the form with combo boxes that have been
populated with items in a table, to narrow down a search with a piece
of equipment that crushes rock.  The form has two date boxes (start
and end dates), customer box, material box, and location box.
Therefore the user can narrow his/her search on many categories.  If I
double click on the query in the database window view, little boxes
come up asking for the values that the query is looking for on the
form.  If I manually type them in at this point, the query will run
fine.  However, if I use the actual form to input the data, I get a
box that pops up that has the error message "The expression is typed
incorrectly or it is too complex to be evaluated... ".  I have read
some other posts and many feel that this could be a reflection in the
way that I set up my date information.  On the form, I have set up
text boxes for the user to input the dates.  They are set up as "Short
Date" boxes with the input mask 00/00/00.  In the query, the following
has been set up to find the dates (I got this from the help of others
on this forum):

Between CDate([Forms]![frmCrusherSearch]![StartDate]) And
CDate([Forms]![frmCrusherSearch]![EndDate])

In the table that stores all of the dates, they are also set up as
"Short Dates"

Can anyone think of any reason why I get this error when I run the
form and not when I manually enter in the data on the query (I think
it's something to do with the dates on the form).  Also, while I'm
writing, how would I set up the form so that if the user left one of
the boxes blank, that it would include all of the records for that
entry (ie) if they left the customer box blank, it would include all
of the customers within the criteria of the rest of the boxes (date,
location, etc.).

Thanks in advance for any help,

John
Simon - 21 May 2007 10:27 GMT
Criteria should read, Between Forms![frmCrusherSearch]![StartDate] And
Forms![frmCrusherSearch]![EndDate]

> Hello,
>
[quoted text clipped - 35 lines]
>
> John
John W. Vinson - 21 May 2007 18:48 GMT
>Criteria should read, Between Forms![frmCrusherSearch]![StartDate] And
>Forms![frmCrusherSearch]![EndDate]

And you should also copy those criteria into the Query's Parameters box (right
mouseclick the background of the tables and select Parameters), and define
them both as being of Date/Time type.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.