Using the Autonumber

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

Thanks for reading this post.
I have a search routine where I search for an item then when I click on the
"Find Item" it is supposed to to that item. The problem is that before it
goes to the item I get an error. I believe its a data miss match

The field I'm trying to search on is an autonumber field called IdNumber.
Its probably something simple. I'm wondering if it has something to do with
line 50

20 Parent!cmdFind.SetFocus
30 Parent!SubFrmFind.Visible = False
40 With Parent.RecordsetClone
50 .FindFirst "IdNumber = '" & IdNumber & "'"
60 If Not .NoMatch Then
70 Parent.Bookmark = .Bookmark
80 Else
Beep
90 Call MsgBox("This Item is not on this list..", vbInformation,
Application.Name)
100 'FilterOn = False
110 End If
120 End With

Thanks for your help
 
J

Jeff Boyce

Your code tells Access to look for a text value (the single quotes do that).

Jon's version leaves those out, telling Access to look for a numeric value.

What kind of value is your IdNumber?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
A

Afrosheen via AccessMonster.com

It is an auto number field, so I guess that would be a number field.

Thanks for the replies


Jeff said:
Your code tells Access to look for a text value (the single quotes do that).

Jon's version leaves those out, telling Access to look for a numeric value.

What kind of value is your IdNumber?

Regards

Jeff Boyce
Microsoft Access MVP
Thanks for reading this post.
I have a search routine where I search for an item then when I click on
[quoted text clipped - 22 lines]
Thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top