Error 2455 opening Form from Switchboard

M

Murray Hopkins

Hi,

I have a form with 5 subforms (each one on a tab page). The subforms have
their Recordsets assigned as follows:

Private Sub Form_Open(Cancel As Integer)

Me.DailyAttractRM.Form.RecordSource = "Select * FROM ....etc"

End Sub

When I open the form via the Switchboard (Open form in Edit mode), I get the
runtime error 2455 - "You entered an expression that has an invalid
reference to the property Form/Report". I get the same error if I try to
access some other object on the DailyAttractRM sub form. I get the same
error if I open this form via a button click from another form and use the
DoCmd.OpenForm method.

However, if I open the form by double clicking the form directly from the
list of form objects, it works perfectly !!

The other weird thing is that it was working for a few weeks and then
suddenly started giving this error even though I didnt make any changes to
that form (or sub form) (at least as far as I can remember, anyway).

Any ideas ?

Thanks,
Murray
 
M

Murray Hopkins

Hi,

Further to my last post - it has now started giving the error even when I
double click the Form object.

Still OK if I go via design view though.

Weird.

Murray
 
L

lucy

Ok, I got mine working again. I'm always running into problems while
working in the visual basic editor and saving after my code has made
changes to the form (while debugging). Somehow the default state for
the form had changed so DataEntry was set to yes, when it shouldn't
have been, as well as the last filter. Now it's working again. Guess
I must be more careful editing code and saving while in the middle of
debugging. Better to close the form unsaved first.
 

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


Top