Results 1 to 4 of 4
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Data Type Mismatch in Criteria Expression

    The expression in green is in our system a long time, and it always worked. I needed the same to work elsewhere, the one in red. I copied it and focus on changing fields carefully. It returns the error "Data Type Mismatch in Criteria Expression". CmbEnt_ID003 and IntItmID011 is both of the "Number" Data type.



    Me!VatRate004 = DLookup("VatRate063", "t02VatRate", "VatCode063='" & Me!VatCodeSales004 & "' And #" & Format([Forms]![f02SalesInvoice]![txt_DocumentDate], "yyyy/mm/dd") & "# Between [StartDate063] And [EndDate063b]")


    Me!MnmAdjSlsPrc011 = DLookup("AdjstmntPrcntge003", "q02MngmntAdjSlsPrice", "CmbEnt_ID003='" & Me!IntItmID011 & "' And #" & Format([Forms]![f01Inventory]![T103], "yyyy/mm/dd") & "# Between [FromDate003] And [ToDate003]")

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If the first field in the criteria is not text, delete the single quotes around the value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thanks Paul it works. I overlooked it not being text.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Data type mismatch in criteria expression.
    By KERRYDEE in forum Access
    Replies: 2
    Last Post: 05-06-2016, 11:56 AM
  2. Data type mismatch in criteria expression
    By hazeleyre23 in forum General Chat
    Replies: 2
    Last Post: 03-24-2016, 05:33 AM
  3. Data type mismatch in criteria expression.
    By pipoconanan45 in forum Reports
    Replies: 1
    Last Post: 09-09-2015, 06:26 AM
  4. Replies: 5
    Last Post: 02-25-2015, 08:42 AM
  5. Data type mismatch in criteria expression
    By Douglasrac in forum Forms
    Replies: 3
    Last Post: 11-23-2010, 10:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums