Weird message on form

J

Jonathan Blitz

When I open a form with a subform I get a message about an SQL error.
However, if I open the subform directly or I remove the subform from the
mainform and open the mainform the message disappears!

There is no code on the open event that could make this happen.

What could it be?


--
Jonathan Blitz
AnyKey Limited
Israel

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
S

Sandra Daigle

Hi Jonathan,

With out more information I'm just guessing but it sounds like the
RecordSource Query of the subform refers to a control on the same form. The
reference to a control would be different when the form is used as a subform
than when used standalone.

For example - as a standalone, a reference like this is correct:

forms!frmMyForm!Text1

As a subform, this would be:

forms!frmMyMainForm!MySubformCtl.form!myText1

Where 'frmMyMainForm' is the name of the main form and 'MySubFormCtl' is the
name of the subform control on the main form. Note that the subform control
is *not* necessarily the same name as the form object used in the subform.

For more help, post the SQL of your query and the names of the relevant
forms, controls and subform controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Thought you should see this 1
Error message on startup 0
Error message on startup 0
Show gif while form is "thinking" 9
Hiding an empty value 4
Empty subform 2
Leave button pushed in 2
Hding menu bar 2

Top