Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Forms works in isolation BUT NOT as a sub form

Posted on 2011-09-02
5
271 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 250 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 250 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

789 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