locateing an item in a combo box.

  • Thread starter Thread starter Ben Wallace \(3\)
  • Start date Start date
B

Ben Wallace \(3\)

I have a combo box, and I would like to find and select a item in the combo
box list, based on it's bound column value. How can I do this in access
2000.

Thanks,

Ben
 
Just set the value of the combo to the value to use for the bound column,
e.g.:
[combo1] = 99
 
Thanks, once I set the value, the cbo is not showing the item I set it to,
any ideas?


Allen Browne said:
Just set the value of the combo to the value to use for the bound column,
e.g.:
[combo1] = 99

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ben Wallace (3) said:
I have a combo box, and I would like to find and select a item in the
combo box list, based on it's bound column value. How can I do this in
access 2000.
 
Ben said:
I have a combo box, and I would like to find and select a item in the combo
box list, based on it's bound column value. How can I do this in access
2000.


Just set the combo box's Value to the desired bound column
value:

Me.combo = idvalue
 
Is the bound column zero-width? If so:
- Is the value you wish to display actually in the combo's RowSource?
- Or are you altering the RowSource in the Current event of the form?

Is the combo in the header of a form where the detail section is completely
blank (becuase no records are loaded, and no new records can be added)? If
so, see:
Incorrect display of data
at:
http://allenbrowne.com/bug-06.html

Is there other code that could delay the repainting of the form so that it
displays the new value? Does a Repaint solve the problem? Does the correct
value show up if you move focus to the combo?

Is the value actually being accepted into the combo, or is it being silently
discarded? You could test that by opening the Immediate Window (Ctrl+G) and
entering something like this:
? Forms("MyForm")![combo1]

In what event are you attempting to write this value to the combo?

Is this in a form or report?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ben Wallace (3) said:
Thanks, once I set the value, the cbo is not showing the item I set it
to, any ideas?


Allen Browne said:
Just set the value of the combo to the value to use for the bound column,
e.g.:
[combo1] = 99


Ben Wallace (3) said:
I have a combo box, and I would like to find and select a item in the
combo box list, based on it's bound column value. How can I do this in
access 2000.
 
Back
Top