Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jump to a record from a List Box search 1

Status
Not open for further replies.

mp3455

Technical User
Jul 18, 2008
8
US
I'm working with a school database and I'd like to add a search function that will display a list of students with a command button that will jump to that particular record. I'm having a devil of a time with the code for the command button. Here's what I have so far:

Private Sub ShowRecord_Click()
DoCmd.OpenForm "Student Profiles", , , _
"[Students.ID]=" & _
"'" & Me.List0.Column(0) & "'"
DoCmd.Close acForm, "F_ListSearch"
End Sub

Any suggestions?
 
is the id field a text if not then it should be

"[Students.ID]=" & Me.List0.Column(0)

 
Thanks for your reply, pwise.

It's actually an autonumber. I now see this code works when the table reference is switched to a text field, but since my records don't have unique text fields, I need to work with the ID autonumber. Is this doable?
 
How are ya mp3455 . . .

Did you try [blue]pwise[/blue] suggestion?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
D'oh. I did, now that I've looked at it again. It's working fine now with his suggestion.

Pwise, I completely misread your post. Thanks to you and TheAceMan1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top