Weird message on form

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
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."
 
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.
 
Back
Top