There's no such thing as a stupid question, but they're the easiest to answer.


Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Creating a search field in MS Access Form


Fatmah's Avatar
Fatmah Fatmah is offline
Junior Member with 3 posts.
Join Date: Feb 2001
20-Mar-2001, 01:07 PM #1

On the form that I have on my Access Database, I would like to add a field in the form so that I can do a search by ID # and hence pull up the information for the record matching this ID #.

I am somewhat familiar with Access. I would really appreciate any help that you could provide.



Anne Troy's Avatar
Computer Specs
Member with 11,731 posts.
Join Date: Feb 1999
Location: Allentown, PA
Experience: Intermediate
20-Mar-2001, 06:05 PM #2
Doesn't the form wizard automatically give you the id field to type into? Are you saying you want a dropdown box instead of the regular field-type box?
YSB's Avatar
YSB YSB is offline
Senior Member with 779 posts.
Join Date: Mar 1999
Location: New York City
22-Mar-2001, 03:03 AM #3
The easiest way to do this is with VB. Create a textbox in the forms header or footer and name it (at least for my example) txtIdFind. Create a command button next to it marked 'Find' and named cmdFind. Then put the following code into the command button (in the forms VB Code module).

Private Sub cmdFind_Click()

Me.Recordset.FindFirst "[NameOfIdField] = " & NZ(Me!txtIdFind,0)

End Sub

That should do it. Let us know how it goes. Good Luck!
iam7617115's Avatar
iam7617115 iam7617115 is offline
Junior Member with 9 posts.
Join Date: Jan 2003
Location: National City
24-Jan-2003, 01:10 AM #4
Angry same problem
i am having the same problem.. and i did that.. but it wont work.. i changed the field name to exactly that.. and then the command button as well.. i copied the code into the vb editor and it wont work when i click the button.. wat is going wrong?
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

You Are Using: Server ID
Trusted Website Back to the Top ↑