Results 1 to 4 of 4
  1. #1
    manicminer is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    8

    getting data

    Hello, I have this statement:
    Set rst = CurrentDb.OpenRecordset("select * from ECR where [Serial] = " & frm_prehliadka_vyberkasa)

    which ends with a runtime 3464 - data type mismatch in criteria expression. Serial is a text field in an ECR table and frm_prehliadka_kasa is a text field in current form.



    I actually try to select the correct row from a table to be able to edit it. What am I doing wrong ? :-(

  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,652
    The syntax for text would be like:

    Set rst = CurrentDb.OpenRecordset("select * from ECR where [Serial] = '" & frm_prehliadka_vyberkasa & "'")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    manicminer is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    8
    Wow, thanks a lot !!!! It works as intended. Now I'll have to find out why :-)
    Thanks again ! :-)

  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,652
    No problem! Generally speaking text values need to be surrounded by quotes, so that will result in

    Where serial = 'abc'

    More here if you're interested:

    http://www.baldyweb.com/BuildSQL.htm
    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. Replies: 1
    Last Post: 12-21-2011, 02:11 PM

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