Error 2455 behaviour

G

Guest

Can anyone tell me where to look for resolution?

I get error 2455 for invalid reference when I start my DB. It fails on a
current event I added to a 3rd level subform. If I end OR debug and stop the
debugger, the subform works just fine.

The OnCurrent is nothing more than "Me.txtType= Forms![frm1
Client]![Reservationfrm].Form!ScheduledPOfrm.Form!txtScheduleType". I am
testing via VBA because I am wholly unable to determine a reference #error
using txtType's control source. I let the system find it and I get #error.

What might be causing its error at startup and not OnCurrent otherwise?

Or what might be causing the #error using control source?

Thanks.
 
B

BruceM

I'm a little confused. If this code is in the third level subform's Current
event, then txtType is on that subform. Is so, why set it to the same value
as another control on the same subform? Maybe I'm just not following what
is happening here.

Anyhow, as I understand it, the "innermost" subform loads first, then the
next one, then the main form. If code in the Current event of the
"innermost" subform references higher-level subforms and the main form,
which have not loaded yet, I think you can get that reference error.

I'm not sure what to suggest since I don't fully understand the situation
(and may be off the mark completely), but in general I think you need to
find another place to set the control's value.
 
G

Guest

Thanks, Bruce. I found another place to put it and its working. Simply the
higher level subform. It must be the order you suggested.

I went to VBA because I just could not get the control reference to work.
Its simple enough. I wanted a control source on one third level subform to
show what is in a control on the second level subform. Several controls
reference correctly, one particular reference just does not work. So, the
workaround. I thought corruption, rebuilt, no change. Its 2007 Access and
it does not seem to operate exactly as before.

Thanks so much.



BruceM said:
I'm a little confused. If this code is in the third level subform's Current
event, then txtType is on that subform. Is so, why set it to the same value
as another control on the same subform? Maybe I'm just not following what
is happening here.

Anyhow, as I understand it, the "innermost" subform loads first, then the
next one, then the main form. If code in the Current event of the
"innermost" subform references higher-level subforms and the main form,
which have not loaded yet, I think you can get that reference error.

I'm not sure what to suggest since I don't fully understand the situation
(and may be off the mark completely), but in general I think you need to
find another place to set the control's value.

redFred said:
Can anyone tell me where to look for resolution?

I get error 2455 for invalid reference when I start my DB. It fails on a
current event I added to a 3rd level subform. If I end OR debug and stop
the
debugger, the subform works just fine.

The OnCurrent is nothing more than "Me.txtType= Forms![frm1
Client]![Reservationfrm].Form!ScheduledPOfrm.Form!txtScheduleType". I am
testing via VBA because I am wholly unable to determine a reference #error
using txtType's control source. I let the system find it and I get
#error.

What might be causing its error at startup and not OnCurrent otherwise?

Or what might be causing the #error using control source?

Thanks.
 
B

BruceM

OK, I think I see now. I had lost track of the levels. I don't have Access
2007, so I'm not that familiar with its quirks, but I recall a situation in
which I tried to reference the main form too soon, so I passed that along.
Glad to hear you got it working.

redFred said:
Thanks, Bruce. I found another place to put it and its working. Simply
the
higher level subform. It must be the order you suggested.

I went to VBA because I just could not get the control reference to work.
Its simple enough. I wanted a control source on one third level subform
to
show what is in a control on the second level subform. Several controls
reference correctly, one particular reference just does not work. So, the
workaround. I thought corruption, rebuilt, no change. Its 2007 Access
and
it does not seem to operate exactly as before.

Thanks so much.



BruceM said:
I'm a little confused. If this code is in the third level subform's
Current
event, then txtType is on that subform. Is so, why set it to the same
value
as another control on the same subform? Maybe I'm just not following
what
is happening here.

Anyhow, as I understand it, the "innermost" subform loads first, then the
next one, then the main form. If code in the Current event of the
"innermost" subform references higher-level subforms and the main form,
which have not loaded yet, I think you can get that reference error.

I'm not sure what to suggest since I don't fully understand the situation
(and may be off the mark completely), but in general I think you need to
find another place to set the control's value.

redFred said:
Can anyone tell me where to look for resolution?

I get error 2455 for invalid reference when I start my DB. It fails on
a
current event I added to a 3rd level subform. If I end OR debug and
stop
the
debugger, the subform works just fine.

The OnCurrent is nothing more than "Me.txtType= Forms![frm1
Client]![Reservationfrm].Form!ScheduledPOfrm.Form!txtScheduleType". I
am
testing via VBA because I am wholly unable to determine a reference
#error
using txtType's control source. I let the system find it and I get
#error.

What might be causing its error at startup and not OnCurrent otherwise?

Or what might be causing the #error using control source?

Thanks.
 

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

Top