data type mismatch in criteria expression date field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • accessbeginerry
    New Member
    • Apr 2010
    • 8

    #1

    data type mismatch in criteria expression date field

    Hello,

    i am starting to give up :( search the forum and tried to correct my mistakes - but no luck. Does anyone have a clue what i am doing wrong?

    I have a form and subform.

    I have a button on my form to delete exact record and all related records on subform, but i get date type mismatch criteria error while i am trying to run Sql. The delete criteria is based on two values - one is Text value and another is Date. I tested the delete criteria only with text value everything is working fine, so i am trying to work with Date field. Heres my SQL:


    this one pops up the error msg :( :

    Code:
    strSQL = "Delete * From tblThings Where [tblThings].[Order_date]= #" & Me![Order_date] & #" ;"
    DoCmd.RunSQL strSQL
    This one is ok:

    Things_ID - text

    Code:
    strSQL = "Delete * From tblThings Where [tblThings].[Things_ID]='" & Me![Things_ID] & " ';"
    I need to combine those two sql in one sql but something wrong with date type sql

    Can anyone help me?
  • accessbeginerry
    New Member
    • Apr 2010
    • 8

    #2
    Never mind, got it right after adding format function

    Comment

    Working...