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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|