A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo box Subform Control Default



 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2009, 03:20 PM posted to microsoft.public.access.forms
hannah
external usenet poster
 
Posts: 66
Default Combo box Subform Control Default

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!

  #2  
Old November 15th, 2009, 01:03 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Combo box Subform Control Default

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" wrote in message
...
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!



  #3  
Old November 16th, 2009, 10:28 AM posted to microsoft.public.access.forms
hannah
external usenet poster
 
Posts: 66
Default Combo box Subform Control Default

Thanks Jeanette. I've got it working now and it looks so much better. Thanks
ever so much again!

Hannah

"Jeanette Cunningham" wrote:

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" wrote in message
...
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!



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.