find files using query combo box and command button

G

Guest

I used Access 2000 in which we kept track of clients. There was what I
thought was a combo box in which we typed either a Social security number or
a name then clicked a comand button one labled either SSN or Name. Then a
list would appear for us to select the client we wanted and there file would
come up in form view. How can I recreat this in a new database. I am a
novice.
 
G

Guest

Hi

I have assumed that you have a field called [SocialSecurityNumber] which
contains "text". Create a new combo box ( call it SSSearch ) and on the
AfterUpdate event place this small bit of code.


Private SSSearch_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SocialSecurityNumber] = " & Str(Nz(Me![SSSearch], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub


You can also assist users by having the combo "drop down" when a user clicks
or enters (the combo has focus).

On the On Got Focus event place this code

Private Sub SocialSecurityNumber_GotFocus()
Me.SocialSecurityNumber.Dropdown
End Sub

Hope this helps
 

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