Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing >Date() from form to query causing probs

Status
Not open for further replies.

cashe

Technical User
May 4, 2002
60
GB
Hi all,

I think I'm missing something simple but don't know what it is

I have a Search Form which has 3 check boxes on it. when a check box = True it passes a criteria to a text box. The text box then passes the criteria to a query.

Check box Check_Mob passes >=Date() to [Criteria13] and Check_Demob passes <Date() to [Criteria13]. In the Demobilised field of the query I have [Forms]![frmPowerSearch]![Criteria13] set in the criteria row. However this does not work.

I have tried setting the query parameters to [Forms]![frmPowerSearch]![Criteria13] DateTime but still no luck

I have 12 other text boxes that are parameters for the query. These all work great. Any ideas why it does not work when <Date() or >=Date() are passed through.

Thanks in advance

Cashe ;-)
 
Cashe,

It's hard to tell what exactly is being passed without seeing the code that builds the sql, or the sql from the query, but you have to offset dates with # in sql. If you're doing this is code you'll have to include those. If you're doing it via a parameter query I would guess that you would want the text box to hold the actually date, not the function call, as it's going to get passed as a literal, I would think.

Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top