Solved

Forms works in isolation BUT NOT as a sub form

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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