Setting a combo to the record selected in a form

peterhosier

New member
Local time
Today, 12:49
Joined
Feb 8, 2005
Messages
5
Hello,

I suspect this is probably rather easy, but I've not been able to figure it out:

I am using a combo to select a record in a form. This works.

The problem is: When I navigate through the records in the form, the combo box does not "update". I need to be able to change the record displayed in the combo box as the record in the form changes.

Any ideas?

Many thanks in advance for assistance.
 
On Current

On Current Event of form:

Me.cboYourCombo.Requery

Not sure if that will do the trick but give it a go?
Phil.
 
I tried this already & it didn't work.

Thanks anyway for the reply. Any other ideas?
 
Sample Db is attached

Within the form "ServiceStandards_FRM" you'll see the combo along the top. When I navigate through the records using the navigation bar at the bottom I want the combo to change to display the same record.

Thanks a lot for your help
 

Attachments

Not Sure?

Had a look. The combo is an unbound control and is simply used for selection purposes. I have only ever used this method as a quick search.

For a combo to retain the data as you wish would require it to be bound to the underlying control (but don't quote me on that).

I am no whizz!!!!

Hopefully somebody with a little more knowledge will have a look.

Sorry I can't help on this one.
Phil.
 
Can anyone help on this?

I have two combo boxes. When you select a value in either of them, the record populates the form. However, I want combo box 1 to update combo box and vice versa.
 
Solution

I've managed to work out how to do this. As I suspected, it's incredibly easy. You need one line of code under the 'On Current' event property:

e.g.

Records_cbo= [Process_ID]

where Records_cbo is the name of the combo box and [Process_ID] is the Primary key field of the record you wish to display.

This will set the record displayed by the combo box equal to the record selected by the navigation bars at the bottom of the form.
 
Chunk - for your issue,

I'd try adapting this code to something like:

Combo1 = Combo 2 = [Primary_ID]

or maybe 2 lines of code under the Event Current property, one for each combo box. Should work
 

Users who are viewing this thread

Back
Top Bottom