By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Subform trigger through a combo box selection

P: 72
Hello Everyone,

I am looking for a way to trigger specific subforms to come up in a form through a combo box selection. For example purposes my selection in the combo box is CCP-03-081-FRM-14. The Subform is,"Area14".

I also have the combo box populating other fields in my form.

I am running Vista Home Premium with Access 2007.

Thanks for any info!
Jun 6 '07 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,365
Hello Everyone,

I am looking for a way to trigger specific subforms to come up in a form through a combo box selection. For example purposes my selection in the combo box is CCP-03-081-FRM-14. The Subform is,"Area14".

I also have the combo box populating other fields in my form.

I am running Vista Home Premium with Access 2007.

Thanks for any info!
Use the after update event to change the subform control's SourceObject property.
Jun 6 '07 #2

P: 72
Use the after update event to change the subform control's SourceObject property.
As the newbie that I am to doing this, can you give me an example of the code and if I use MACRO, EXPRESSION or CODE BUILDER.

Thanks for the input
Jun 6 '07 #3

Rabbit
Expert Mod 10K+
P: 12,365
I use 03 so I don't know how well this code will work in 07, plus I haven't tested it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combobox1_AfterUpdate()
  2.    Select Case Combobox1
  3.       Case "Option1"
  4.          Me.SubformName.SourceObject = "Form1"
  5.       Case "Option2"
  6.          Me.SubformName.SourceObject = "Form2"
  7.    End Select
  8. End Sub
  9.  
Jun 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.