1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Creating a search field in MS Access Form

Discussion in 'Business Applications' started by Fatmah, Mar 20, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. Fatmah

    Fatmah Thread Starter

    Joined:
    Feb 9, 2001
    Messages:
    3
    HELP, HELP, HELP!

    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.

    Thanks

    Fatmah

     
  2. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,731
    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?
     
  3. YSB

    YSB

    Joined:
    Mar 7, 1999
    Messages:
    779
    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! :)
     
  4. iam7617115

    iam7617115

    Joined:
    Jan 13, 2003
    Messages:
    9
    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
As Seen On...

Welcome to Tech Support Guy!

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/40232