Can You Point Me In The Right Direction Regarding Lookups?

G

Guest

Hello - Here is what I am working on. I am creating a database for a local
free poker club. I have set it up so each player has their own poker id
number. I would like to be able to open the form, which is where I keep
their information, and type in their poker id number and upon hit TAB it
brings up that person's record. This may all sound very easy but I am not
sure how I turn the this text box into this function to work. Any
information or links would be appreciated.
 
S

Scott McDaniel

Personally, I'd not mess with the TAB key, just add a button labelled
"Search" and do this in that button's click event:

Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone

rst.FindFirst "[YourPokerIDField]=" & Me.YourTextBox
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
Else
Msgbox "Sorry, couldn't find it"
End If

Set rst = Nothing

If [YourPokerIDField] is a Text field., change this line:
rst.FindFirst "[YourPokerIDField]='" & Me.YourTextBox & "'"

You will obviously have to change table/field/control names to match those
in your project.
 

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