Error on button click

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a form, that has a button. when the button is clicked, a sql
statement is formed. the onlly part of the sql statement that changes is a
where clause.

i have a date field on the form (medium date format) this is used to
compare to the tblMain.Date field (also medium date)

however, i get error 13: Type mismatch whenever i try to use it.

"WHERE (((tblMain.Date)>=#" + [StartDate] + "#));"

but if i replace the " + [StartDate] + " with say, 1/1/2000 i.e. "WHERE
(((tblMain.Date)>=#1/1/2000#));" i get the query result.

am i missing something?
 
why an ampersand instead of a plus?

Kc-Mass said:
Substitute an ampersand (&) for each plus sign (+)

Kevin C


Mike said:
i have a form, that has a button. when the button is clicked, a sql
statement is formed. the onlly part of the sql statement that changes is
a
where clause.

i have a date field on the form (medium date format) this is used to
compare to the tblMain.Date field (also medium date)

however, i get error 13: Type mismatch whenever i try to use it.

"WHERE (((tblMain.Date)>=#" + [StartDate] + "#));"

but if i replace the " + [StartDate] + " with say, 1/1/2000 i.e. "WHERE
(((tblMain.Date)>=#1/1/2000#));" i get the query result.

am i missing something?
 
Back
Top