Combo Box and form selection

  • Thread starter Thread starter jamie
  • Start date Start date
J

jamie

I am fairly new to Access so forgive the simple question...

I have a table called Student_Table and there are 2 values
in the table that I want to select in a combo box,
preferably concatenated, last_name and first_name.

If I can get this combo box displayed properly, I then
want to create a button that runs a macro that will access
the record selected in the combo box and open the form
called student_form with the record that was selected in
the combo box. Any thoughts?? Thanks.
 
I am fairly new to Access so forgive the simple question...

I have a table called Student_Table and there are 2 values
in the table that I want to select in a combo box,
preferably concatenated, last_name and first_name.

If I can get this combo box displayed properly, I then
want to create a button that runs a macro that will access
the record selected in the combo box and open the form
called student_form with the record that was selected in
the combo box. Any thoughts?? Thanks.

If you don't already have one, consider adding a unique StudentID
field: if you school has student numbers use that, or you may want to
use an Autonumber. Names ARE NOT UNIQUE - I went to school with
another John Vinson for a while.

You can base your Combo on a Query like:

SELECT StudentID, [LastName] & ", " & [FirstName] AS StudentName
ORDER BY LastName, FirstName;

Use the StudentID as the bound column (storing a student ID in your
table or looking it up), but set its width to zero so what shows in
the combo is the name.

The combo box wizard will offer you the option "Use this combo box to
find a record" - or if it doesn't, post back, it's a bit of VBA code
but not difficult.
 
Back
Top