Searching and displaying info in a form (1 Viewer)

J

jpmetcal

Guest
I have created a database that stores student information, including name phone number student ID ect... I would like to be able to have a field in a form that you enter the students ID into and it then shows all of thier information. I created a search button using the wizzard but I don't want to use the Microsoft search window to look up the info. I'm new at this so be gentle


Thanks,
Josh
 

Carol

Registered User.
Local time
Today, 21:29
Joined
Jan 15, 2000
Messages
280
Your selection field for the Student ID look-up should be an unbound combo box. Your form should be based upon the table or query that holds all the information. On your combo box for your Row Source Type, input table/query, then list the table or query name. On your "After Update" in your combo box properties, insert this Event Procedure Code:
Sub StudentID_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[StudentID] = '" & Me![StudentID] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
When you user selects a specific Student ID, all the matching information will be filled in the appropriate fields.
You will have to change the field names as required. I have assumed your Primary Key is called StudentID.

Good Luck
 

Users who are viewing this thread

Top Bottom