Sorry, I am confused at this point.
Are you trying to requery the combobox and then set its value to the first
row? If so, would you care to show us the VBA code you are trying to use and
where you are trying to use it?
I would expect to see something like the following in your code.
Me.NameOfCombobox.Requery
Me.NameOfCombobox = Me.NameOfCombobox.ItemData(0)
'With this temporary line to check to see what is assigned to the combobox
Debug.Print Nz(Me.NameOfCombobox,"NULL VALUE")
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
By any chance is the bound column value NULL on the first item in the combo?
If so, then
=[comboname].ItemData(0)
will not work. The Null messes things up since Null never matches anything,
including null.
Also, I assume that you are using [ComboName] as a generic example for the
actual name of the combobox and are using the actual name of the combobox in
the expression.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Dave wrote:
I have an unbound combo box which selects its values from an SQL
statement. I would like this control to default to the first row of
the combo box. BUT, it absolutely refuses to do so. I've tried
[comboname].ItemData(0) in the default property and every other
combination I can think of and nothing! Any ideas??
Dave- Hide quoted text -
- Show quoted text -
Actually, I got it to work if I change the form to design view and
back again. It won't requery no matter where I put a requery request.
Arrgh.
Dave- Hide quoted text -
- Show quoted text -