Subform Combo box issue

pablotx

Registered User.
Local time
Today, 20:46
Joined
Feb 20, 2003
Messages
79
Hello all,

Have a problem with my subform. It works fine on its own, but when I try and work with it on the main form, I start getting error messages. I have a feeling it has something to do with event procedures needing to refer to the main form, but I'm not certain.

Any help with the coding would be greatly appreciated.

Thanks in advance.
 

Attachments

When referring to a subform's control you have to state it like this:
Forms![mainform]![subform]!Form![Control]

So intead of having this:
[Forms]![tblDetail subform]![cmbOutcome]

You should have this:
[Forms]![frmMain]![tblDetail subform]![form]![cmbOutcome]

That will fix your problem, anyways i suggest you look for "cascading combo boxes" in this forum. You may find how is done in a more effective way.

I also suggest you to not use names with spaces like [tblDetail subform] or like some of your fields on your tables, use a _ (underscore) instead or just have them together. And your [tblDetail subform] to [sfmDetail]. This will save you a lot of headaches in the future.
 
Thanks for the reply, but I can't figure out where to put the code you responded with. Can you repost a fixed version of the database so I might take a look? Also, I have looked into the Cascading combo box idea, but don't know if necessarily helps my cause alot. The lut will not ever be changing. What is the main rationale for using cascading comboboxes in this instance?

Thanks again for all of your assistance.
 
That is on your combobox rowsources in tblDetail subform
 
Fernando,

Unfortunately it didn't work. Can you please make the change on the attachment so that I might see what I am doing wrong?

Thanks again.
 
Thanks!!! First part works like a charm now. But for some reason, the Principle Combobox is not updating properly. Hopefully this is my last question on this topic. Thoughts?
 
in cmbPrinciple rowsource's criteria for performance, chamge cmbOutcome to cmbPerf.

I havent seen your tables but now that i have, you should try to read about "Database Normalization" your db needs to be normalized.
 
Fernando,

Works perfectly. I definitely agree with you about the database normalization. The example we have been working on was just so I can test a particular theory. I do plan on spending a fair amount of time on setting up tables and relationships when I begin the project.

Thanks for all of your help.
 

Users who are viewing this thread

Back
Top Bottom