Combo box Subform Control Default

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!
 
J

Jeanette Cunningham

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
 
H

Hannah

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!


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top