?
Solved

Forms works in isolation BUT NOT as a sub form

Posted on 2011-09-02
5
Medium Priority
?
280 Views
Last Modified: 2012-05-12
Example: I sell car parts !  I have a combo for the make of car.   Depending on the make chosen I have a combo for the model of car.  Depending on the model chosen I have a combo for the car part etc.

See frmOrdDetTypes which has 4 drop downs which work fairly well (not perfectly).

However, if I put frmOrdDetTypes in frmCustomers and then run frmCustomers - ERRORS! when if go into the sub form frmOrdDetTypes

Why does frmOrdDetTypes work on its own but NOT as a sub form

KeylightMaintenance.zip
0
Comment
Question by:Patrick O'Dea
  • 2
  • 2
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36476133
it works here!!!

try doing a compact and repair
0
 

Author Comment

by:Patrick O'Dea
ID: 36476189
Thanks capricorn1,
Are you saying that you can run frmCustomers and then go into subForm frmOrdDetTypes and then choose from the 4 levels of drop downs - with no errors  ??

0
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 1000 total points
ID: 36476201
It will work if frmOrdDetTypes is open as a main form, but not as you want

The problem is each query's references to Forms!frmOrdDetTypes!ComboX. This type of notation expects that frmOrdDetTypes is open as a main form, not a subform. The queries bomb won't run if frmOrdDetTypes is not open / open only as a subform.

You can get around this by changing the criteria in each query to [Combo6], [Combo14], etc. without the Forms!frmOrderDetTypes!

This way, the query finds a value for [Combo6] within the context of the current form.

HTH,
pT72
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 36476294

test this

the format for the reference is

forms!nameofmainform!subformcontrolname.form!controlname
KeylightMaintenance.accdb
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 36477244
Thanks guys!  Great explanations!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question