Referencing a control on a subform

G

Guest

I have a main form (frm1) with a subform control (sub1) and I want to attach
code to the GotFocus event of a control (ctl1) on the subform and store its
contents. I have looked at previous posts on this topic and the answer seems
to be:

[Forms]![frm1]![sub1name].Form![ctl1name].Value

However I get the error "object or class does not support the set of events"
Please help, I have been struggling with this for days!
 
S

Stefan Hoffmann

hi Kim,
I have a main form (frm1) with a subform control (sub1) and I want to attach
code to the GotFocus event of a control (ctl1) on the subform and store its
contents. I have looked at previous posts on this topic and the answer seems
to be:
[Forms]![frm1]![sub1name].Form![ctl1name].Value
As you are on the subform, you only need ctl1name.Value.


mfG
--> stefan <--
 
G

Guest

I must have mis-diagnosed my problem. I get the error message with no code
in the event at all. The subform is on a tab control--does that make a
difference in how events are triggered?

Stefan Hoffmann said:
hi Kim,
I have a main form (frm1) with a subform control (sub1) and I want to attach
code to the GotFocus event of a control (ctl1) on the subform and store its
contents. I have looked at previous posts on this topic and the answer seems
to be:
[Forms]![frm1]![sub1name].Form![ctl1name].Value
As you are on the subform, you only need ctl1name.Value.


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Kim,
I must have mis-diagnosed my problem. I get the error message with no code
in the event at all. The subform is on a tab control--does that make a
difference in how events are triggered?
No. Have you copied your subform onto the tab control and set the events
manually?


mfG
--> stefan <--
 
G

Guest

That was, indeed, the problem. Thanks so much!

Stefan Hoffmann said:
hi Kim,

Maybe your .mdb is a little bit corrupted. Run repair and compact or
import everything into a new .mdb.


mfG
--> stefan <--
 

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