[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Forms works in isolation BUT NOT as a sub form

Posted on 2011-09-02
5
Medium Priority
?
279 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
[X]
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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

650 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