Searching the Autonumber field

Results 1 to 2 of 2

Thread: Searching the Autonumber field

  1. #1
    Join Date
    Dec 1969

    Default Searching the Autonumber field

    How can I search a table on a Autonumber field? I can search the other fields with datatypes of text etc.. <BR><BR>I get a <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.<BR><BR>I figure I am not giving Access what it wants. How do I give Access the Correct datatype. Right now the input is coming from a form text field (e.g. I just type in a number that i know to be in the table, but no dice on returns)<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Searching the Autonumber field

    Well you did not include any syntax, but I&#039d assume that you are putting the criteria in single quotes &#039&#039. If you are searching through an autonumber field, quotes are not used. You want it like this:<BR><BR><BR>SELECT * FROM TableName WHERE AutoNumberField = " & Criteria & ""<BR><BR>Hope that helps.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts