Subform combobox problem (1 Viewer)

reglarh

Registered User.
Local time
Today, 08:13
Joined
Feb 10, 2014
Messages
118
I have a form giving details of an academic group, with a datasheet subform showing the pupils in the group.

The subform holds the pupil id number and his/her full name.

Currently the pupil ID is entered and the full name appears for confirmation.

I would like to be able to enter new pupils by their name if their ID is not available, using a combobox that filters the names as the use types in the first few characters. When a name is selected, the Id should appear, i.e. the converse of the usual input process.

Not sure how I set about this.
 

Mark_

Longboard on the internet
Local time
Today, 08:13
Joined
Sep 12, 2017
Messages
2,111
Were it me, I would set up a query that holds the ID and the name. I would order by the name but have it fill in the ID. I would show both, that way if you have two students with the same name you can tell which is which.

Look in the Format for your combobox at
Column Count
Column Widths

And look in Data for
Bound Column

You can have a query that holds [StudentID] and [StudentName]
Your Column Count would be two.
Your Column Widths would be 1; 5 or some similar value.
Your Bound Column would be 1.

This would let you have the combobox be on [StudentID] filling in the [StudentID] while showing the both the students ID and name.

With the dropdown ordered by name, you can find the student quickly.
 

reglarh

Registered User.
Local time
Today, 08:13
Joined
Feb 10, 2014
Messages
118
Thanks Mark. I am now away for the rest of the week but will have a go when I return.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:13
Joined
May 7, 2009
Messages
19,175
Another option is a "special combobox" where you can searxh both id and student name.
 

Users who are viewing this thread

Top Bottom