randria wrote:
[Quoted Text] >I have a combo box (cbo2) in a sub subform of a continuous form. I put On >Form_Load() of the sub subform : >Me.cbo2.value = Me.cbo2.itemData(0) >When I open the sub subform on its own, I get the default value for new >record appearing. But when I open the same sub subform within the main form, >I do not see the default value for new record. What could be the problem ?
That code will change the value of the combo box in the first record regardless of whether it's a new record or not. In addition, it will dirty the record even if the user did not intend to make any changes.
Maybe you should set the DefaultValue property instead of the Value property? The DefulatValue property is only applied on the first keystroke on a new record, but you should always see it displayed on any new record.
Me.cbo2.DefaultValue = """" & Me.cbo2.ItemData(0) & """"
OTOH, maybe I don't understand what you are trying to do.
-- Marsh MVP [MS Access]
|