Combo box conundrum

UniqueTII

What?
Local time
Today, 10:45
Joined
Apr 4, 2002
Messages
95
I have a combo box that contains social security number values that I use to select records. In other words, when you choose a SSN from the combo box, you get the record for that student. My problem is that I'd like the value in the combo box to change when records are selected a different way. The combo box is unbound, because I don't want it to change the value in the [StudentID] field, just to filter.

I hope this makes sense.

Here's an example:

If I go to the combo box and select 555-55-5555, the record for the student with that SSN comes up. What I want to do is: if the user scrolls to a different record, let's say one where the student's ID is 777-77-7777, I want the combo box to reflect that value.

The reason I am doing this is so that the people using the DB can search for records based on SSN, but in what appears to be the [StudentID] field.

The more I write the less sense I make...please help. :)
 
Do this in your After Update of your combo box:

Private Sub Find_AfterUpdate()

DoCmd.GoToControl "SS#"
DoCmd.FindRecord Me![Find], A_ENTIRE, False, A_DOWN, False, A_CURRENT

End Sub

Find is the name of your Combobox. :)
 
It's not the update of the combo box that I'm having a problem with. I want the combo box value to change with the value of [StudentID] but they can't be bound, because that would change the value of [StudentID] when the combo box value is changed.

Thanks, though.
 
This might work.

Make a textbox next to the combo box. Make the width of the combo box small so just the arrow fits. Make an event sub for After Update of the combo box. In the sub, move the combo box value to the textbox. Also make the textbox Locked.

Next, make an event sub in the On Current event for the form. So when the user scrolls to a new record, the On Current event fires. In this sub, move the Student ID to the textbox.

Should work.

RichM
 
That would work for pulling the combo box down, but I need the people to be able to type in the value.

Sorry for being a pain, and thanks for the suggestion.
 

Users who are viewing this thread

Back
Top Bottom