Combo box Subform Control Default

  • Thread starter Thread starter Hannah
  • Start date Start date
H

Hannah

Apologies if this is here already - I can't seem to find it and I'm seriously
stumped about how I do it.

I'm working on a main form which has a combo box and a subform control.
Depending on the option picked in the combo box, a different subform appears
in the subform control. When you open the form however, there are just empty
boxes. Is there a way to set a default subform to appear? I'm a bit of an
access newbie so all help would be very much appreciated!
 
Hi Hannah,
here is a way to set the combo box to show the first record on the list.

Me.[NameOfCombo] = Me.[NameOfCombo].ItemData(0)

To make the subform control show the subform for the first item in the
combo, use something like this-->

Call [NameOfCombo]_AfterUpdate


The above 2 lines of code can go on the Load event of the main form.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Thanks Jeanette. I've got it working now and it looks so much better. Thanks
ever so much again!

Hannah

Jeanette Cunningham said:
Hi Hannah,
here is a way to set the combo box to show the first record on the list.

Me.[NameOfCombo] = Me.[NameOfCombo].ItemData(0)

To make the subform control show the subform for the first item in the
combo, use something like this-->

Call [NameOfCombo]_AfterUpdate


The above 2 lines of code can go on the Load event of the main form.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




Hannah said:
Apologies if this is here already - I can't seem to find it and I'm
seriously
stumped about how I do it.

I'm working on a main form which has a combo box and a subform control.
Depending on the option picked in the combo box, a different subform
appears
in the subform control. When you open the form however, there are just
empty
boxes. Is there a way to set a default subform to appear? I'm a bit of an
access newbie so all help would be very much appreciated!


.
 
Back
Top