troubleshooting Question

combobox and subform problem

Avatar of Jenkins
JenkinsFlag for United States of America asked on
Microsoft Access
4 Comments2 Solutions395 ViewsLast Modified:
I have a combobox on a main form.  
The main form does not have a record source.
The record source of the combobox is a table.

I have a subform on the main form. The subform's record source
is a table (different from the one tied to the combobox).
I have a textbox in the header section of the subform.
I want to set its value to whatever the combobox's value is.
If the combobox value changes, I want the textbox value on the subform
to change.

Below is what I already have under the After Update event of the combobox.
What is going on is when a combobox selection is made, the table tied
to the subform is cleared and then populated with data related to whatever
the combobox selection is.  

Private Sub MyComboBox_AfterUpdate()

With DoCmd
   .SetWarnings False
   .Hourglass True
   .OpenQuery "DeleteTemporaryTable"
   .OpenQuery "PopulateTemporaryTable"
   .SetWarnings True
   .Hourglass False
End With

Adding this code to the AferUpdate event (I've tried placing it in different
sections of the code) is causing a 440 run-time error:

 Me.MySubform.Form.MyTextbox = Me.MyComboBox

What's the problem?   Thanks.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros