Confusion about unbound combo boxes ?!?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All my combo boxes are on a tabbed form in a subform in another tabbed form. Because the subform (and all the combo boxes) are loaded when the main form is opened I left the 'rowsource' blank and dont load my combo boxes until they get the focus
I hope you are with me.......
In the onfocus, I chek the rowsource and if blank load the rowsource

Now my question, what if I read a record before the control gets focus. How do I set the value in the combo box? Or, do I have to set the focus first
The combo boxes have multiple columns, usually column 0 is the table value and column1 the displayed value

What is happening is that when I try to update a record sometimes the combo box value is recognized and sometimes it is not. It appears to depend on whether or not the control ever got the focus

This is all very confusing and is eating up my development time.
 
Unless a combobox's LimitToList property is set to No (which is not an
option the way you have yours set up), it will only show a value if that
value matches a record in its rowsource. No rowsource, no value.
You might want to consider populating your comboboxes in the main form's
OnLoad event.

HTH
- Turtle

David said:
All my combo boxes are on a tabbed form in a subform in another tabbed
form. Because the subform (and all the combo boxes) are loaded when the main
form is opened I left the 'rowsource' blank and dont load my combo boxes
until they get the focus.
I hope you are with me........
In the onfocus, I chek the rowsource and if blank load the rowsource.

Now my question, what if I read a record before the control gets focus.
How do I set the value in the combo box? Or, do I have to set the focus
first?
The combo boxes have multiple columns, usually column 0 is the table value
and column1 the displayed value.
What is happening is that when I try to update a record sometimes the
combo box value is recognized and sometimes it is not. It appears to depend
on whether or not the control ever got the focus.
 
Back
Top