|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, June 22, 2012 1:34 PM
Points: 154,
Visits: 216
|
|
I have a 2010 MSAccess database using tables linked (ODBC) to a SQL 2000 database.
I can query dates from the linked SQL table if I use the criteria syntax <#1/6/2009#. So my question then is .. how do I pass the date criteria in this format from a form text box to the criteria for the query. The method I've tried is to put =[forms]![formname]![fieldname] in the criteria field of the query (doesn't work). I'm assuming I need to pass the required # syntax around the date criteria value to the query criteria? I've tried variations of =#[forms]![formname]![fieldname]#... but this does not work. What am I missing?
Thanks..
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, January 08, 2013 8:48 AM
Points: 149,
Visits: 329
|
|
Access automatically inserts the "#"s around a date (as long as the column you are setting your criterion off of is in date format). Because of this, you should only have to enter the date on the form (withouth the "#"s around it).
If you want to manually force Access to read #s, you can use:
"#" & [forms]![formname]![fieldname] & "#"
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Today @ 2:35 PM
Points: 1,456,
Visits: 14,271
|
|
SELECT dbo_ORDER.DATE_ENTERED FROM dbo_ORDER WHERE dbo_ORDER.DATE_ENTERED=[Forms]![Form1]![Text1].......set format of textbox to "general date"
..ps in Access remember to tab out of form text box before running query
__________________________________________________________________ you can lead a user to data....but you cannot make them think ! __________________________________________________________________
|
|
|
|