Referencing a Control on a Sub Form

  • Thread starter Thread starter PR
  • Start date Start date
P

PR

I would like to Reference a Control on a Sub Form can anyone let me know what is wrong with this?

If Forms!frm_main_form.frm_membership_type.Form!AGA = 1 Then
Forms!frm_main_form.frm_bank_details.Form!AGA_Join.enable = True



Regards - Paul
 
It looks to me that "enable" should be "Enabled".

Provided that "frm_membership_type" and "frm_bank_details" are the names of
the SubformCONTROLS which may or may not be the same as the names of the
Forms being used as the Subforms, your code should work with the above
typing error corrected.

--
HTH
Van T. Dinh
MVP (Access)

P.S. Please use Plain Text when posting to newsgroups.



I would like to Reference a Control on a Sub Form can anyone let me know
what is wrong with this?
If Forms!frm_main_form.frm_membership_type.Form!AGA = 1 Then
Forms!frm_main_form.frm_bank_details.Form!AGA_Join.enable = True

Regards - Paul
 
Van,
this is how is broken down:

Forms!
main form: frm_main_form
Sub form: frm_membership_type.
Control on sub form: Form!AGA

Regards - Paul
 
I am not sure whether you fixed the problem or not ...

Remember I wrote that the name "frm_membership_type" must be the name of the
Subform*Control* (think of the Subform Control as the empty rectangle around
the "Subform"). If "frm_membership_type" is only the name of the Form being
used as the Subform (more accurately, being used as the SourceObject of the
SubformControl), it won't work.

You need to use the name of the Subform*Control* for the references to work,
not the name of the Form being used as the SourceObject of the
SubformControl..
 
Back
Top