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  

Dependant combo box in subform



 
 
Thread Tools Display Modes
  #1  
Old January 19th, 2010, 08:54 PM posted to microsoft.public.access.forms
laurenm
external usenet poster
 
Posts: 128
Default Dependant combo box in subform

Hi everyone,

I am using Access 2003 on a Windows XP machine. I am having a little touble
making my dependant combo box work in a subform I have created. If anyone can
help unravel this mystery, I would greatly appreciate it.

I have a main form (AddContacts) and a subform (MediaType). In my subform I
have two combo boxes: One is "MediaType" and the other is "SubMediaType" .
When I select a MediaType, I want the related SubMediaTypes only to show up
in the SubMediaType combo box. This works brilliantly in my subform on its
own. However, when I embed it it my main form (AddContacts), I get a message
indicating that I need to need to enter a parameter value as if I did not
choose a Media Type first (which I can do with no issue in the embedded
subform). In my criteria in the subMediaType row source is
[Forms]![MediaType]![cbo_MediaType]. I am a novice to writing SQL statements
so I am using the query builder. It seems like I need to indicate the main
form in this somehow or I need to maybe do something in the main form? Not
sure. Again any helpful info anyone has would be terrific.

Thanks in advance!
  #2  
Old January 19th, 2010, 11:46 PM posted to microsoft.public.access.forms
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Dependant combo box in subform

Try me.[cbo_MediaType] or forms!MAINFORMNAME.[MediaType]!form.[cbo_MediaType]

Bonnie
http://www.dataplus-svc.com

LaurenM wrote:
Hi everyone,

I am using Access 2003 on a Windows XP machine. I am having a little touble
making my dependant combo box work in a subform I have created. If anyone can
help unravel this mystery, I would greatly appreciate it.

I have a main form (AddContacts) and a subform (MediaType). In my subform I
have two combo boxes: One is "MediaType" and the other is "SubMediaType" .
When I select a MediaType, I want the related SubMediaTypes only to show up
in the SubMediaType combo box. This works brilliantly in my subform on its
own. However, when I embed it it my main form (AddContacts), I get a message
indicating that I need to need to enter a parameter value as if I did not
choose a Media Type first (which I can do with no issue in the embedded
subform). In my criteria in the subMediaType row source is
[Forms]![MediaType]![cbo_MediaType]. I am a novice to writing SQL statements
so I am using the query builder. It seems like I need to indicate the main
form in this somehow or I need to maybe do something in the main form? Not
sure. Again any helpful info anyone has would be terrific.

Thanks in advance!


--
Message posted via http://www.accessmonster.com

  #3  
Old January 20th, 2010, 02:29 PM posted to microsoft.public.access.forms
laurenm
external usenet poster
 
Posts: 128
Default Dependant combo box in subform

Thank you, Bonnie for you response. When I make your suggested changes in the
subform (replacing my original criteria with the criteria you suggested
below), I am still prompted to enter a parameter value for the SubMediaType
to show up while embedded in the main form. It does show up but I need to
type in the value that I chose in the Media Type combo box. Do I need to
change the VBA code that I have in the On Change Event tab on my
cbo_MediaType field in my subform? Now I have it as follows:

Private Sub cbo_MediaType_Change()
Me.cbo_MediaSubType.Value = ""
Me.cbo_MediaSubType.Requery

End Sub

Again, thank you for your time!

"bhicks11 via AccessMonster.com" wrote:

Try me.[cbo_MediaType] or forms!MAINFORMNAME.[MediaType]!form.[cbo_MediaType]

Bonnie
http://www.dataplus-svc.com

LaurenM wrote:
Hi everyone,

I am using Access 2003 on a Windows XP machine. I am having a little touble
making my dependant combo box work in a subform I have created. If anyone can
help unravel this mystery, I would greatly appreciate it.

I have a main form (AddContacts) and a subform (MediaType). In my subform I
have two combo boxes: One is "MediaType" and the other is "SubMediaType" .
When I select a MediaType, I want the related SubMediaTypes only to show up
in the SubMediaType combo box. This works brilliantly in my subform on its
own. However, when I embed it it my main form (AddContacts), I get a message
indicating that I need to need to enter a parameter value as if I did not
choose a Media Type first (which I can do with no issue in the embedded
subform). In my criteria in the subMediaType row source is
[Forms]![MediaType]![cbo_MediaType]. I am a novice to writing SQL statements
so I am using the query builder. It seems like I need to indicate the main
form in this somehow or I need to maybe do something in the main form? Not
sure. Again any helpful info anyone has would be terrific.

Thanks in advance!


--
Message posted via http://www.accessmonster.com

.

  #4  
Old January 20th, 2010, 02:39 PM posted to microsoft.public.access.forms
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Dependant combo box in subform

Try:


Me.Requery




LaurenM wrote:
Thank you, Bonnie for you response. When I make your suggested changes in the
subform (replacing my original criteria with the criteria you suggested
below), I am still prompted to enter a parameter value for the SubMediaType
to show up while embedded in the main form. It does show up but I need to
type in the value that I chose in the Media Type combo box. Do I need to
change the VBA code that I have in the On Change Event tab on my
cbo_MediaType field in my subform? Now I have it as follows:

Private Sub cbo_MediaType_Change()
Me.cbo_MediaSubType.Value = ""
Me.cbo_MediaSubType.Requery

End Sub

Again, thank you for your time!

Try me.[cbo_MediaType] or forms!MAINFORMNAME.[MediaType]!form.[cbo_MediaType]

[quoted text clipped - 21 lines]

Thanks in advance!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

  #5  
Old January 20th, 2010, 04:01 PM posted to microsoft.public.access.forms
laurenm
external usenet poster
 
Posts: 128
Default Dependant combo box in subform

Hi Bonnie,

I figured it out. I had to change my VBA code to read the name of the
subform instead of "Me." I changed it to read:

Private Sub cbo_MediaType_Change()
Form_MediaType.cbo_MediaSubType.Value = ""
Form_MediaType.cbo_MediaSubType.Requery

End Sub


Thanks so much for your ideas!

"bhicks11 via AccessMonster.com" wrote:

Try:


Me.Requery




LaurenM wrote:
Thank you, Bonnie for you response. When I make your suggested changes in the
subform (replacing my original criteria with the criteria you suggested
below), I am still prompted to enter a parameter value for the SubMediaType
to show up while embedded in the main form. It does show up but I need to
type in the value that I chose in the Media Type combo box. Do I need to
change the VBA code that I have in the On Change Event tab on my
cbo_MediaType field in my subform? Now I have it as follows:

Private Sub cbo_MediaType_Change()
Me.cbo_MediaSubType.Value = ""
Me.cbo_MediaSubType.Requery

End Sub

Again, thank you for your time!

Try me.[cbo_MediaType] or forms!MAINFORMNAME.[MediaType]!form.[cbo_MediaType]

[quoted text clipped - 21 lines]

Thanks in advance!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

.

  #6  
Old January 20th, 2010, 05:44 PM posted to microsoft.public.access.forms
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Dependant combo box in subform

I always have to play with it a bit when it's subform references.

LaurenM wrote:
Hi Bonnie,

I figured it out. I had to change my VBA code to read the name of the
subform instead of "Me." I changed it to read:

Private Sub cbo_MediaType_Change()
Form_MediaType.cbo_MediaSubType.Value = ""
Form_MediaType.cbo_MediaSubType.Requery

End Sub


Thanks so much for your ideas!

Try:

[quoted text clipped - 21 lines]

Thanks in advance!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

 




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 10:38 AM.


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