Re: Update query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> >UPDATE " & sTable & " SET [" & sField & "] = " & _
> > "'" & sValue & "' " & _
> > "WHERE [Date]=#" & sDate & "#;"

> It *should* set the value to NULL if the Allow Zero Length is false.
> If this causes problems, you'll need to update it to the word NULL
> without quotes - probably using an IF block in your code to run the
> above query if there is data in sValue, or to NULL if there isn't.

VBA wont allow me to set it to Null. If I set it to "" then it gives me this:

ActionQuery error: Data type mismatch in criteria expression.


The expression (SQL) being passed is :

UPDATE tDayData SET [Daily Sales] = '' WHERE [Date]=#1/1/2005#;

Those are 2 single quotes... I am passing this from Excel using ADO if that
matters...

Ernst.


.



Relevant Pages

  • Re: Cant figure out error in simple dsum
    ... Anyone know whats ... "Data type mismatch in criteria expression" ... quotes. ...
    (comp.databases.ms-access)
  • Re: Whats wrong with my SQL stmt?
    ... If it is a number field then you need to drop the quotes around 1 and 2 in your where clause. ... Gator wrote: ... Data type mismatch in criteria expression. ...
    (microsoft.public.access.queries)
  • get the sql statement
    ... Data type mismatch in criteria expression. ... Protected Sub btnSave_Click(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Error 3464 with dCount - some computers only
    ... Error 3464 - Data type mismatch in criteria expression" from this line ... and produces a recordset with 36 records ... this code (and the print in the immediate window) ...
    (microsoft.public.access.formscoding)
  • Re: sort report by year (weird format)
    ... its okay - i get the error "data type mismatch in criteria expression" ... can i use a query?) ... Marshall Barton wrote: ...
    (microsoft.public.access.reports)