SubForm error

  • Thread starter Thread starter George
  • Start date Start date
G

George

Hello

I have sub_FormA in Form_A

When I enter [Forms]![Form_A]![sub_FormA]
Forms([Forms]![Form_A]![sub_FormA]
).AllowsAddition

I have the error:

Forms sub_FormA not found

What is the problem
 
The problem usually lies in the difference between the name of the subform
and the subform CONTROL on the main form. You never actually reference the
name of the subform, but rather the control on the mainform which holds the
subform. These may have different names and it is necessary to get the
right one. The general form is:

Forms!Form1!subControl1.Form!ControlOnSubform

Without knowing more about your system, I can't say any more.

On my website (see sig below) is a small sample database called
"SubformReference.mdb" which illustrates this and a lot of other things that
have to do with referencing subforms and subsubforms.
 
Hi Roger,

I saw you example.

What I have:

Frm_Client and in this Form I have a Sub_Form: FrmAdresse
both are linked by the ClientID

the Sub_Form Name is FrmAdresse
the source is FrmAdresse

So I'm using the same terminologie

When I use Frm_Client in my Sub instead of Frm_Client!
FrmAdresse it will pass and I don't have any Problem

Besides, Thanks for your web site it's help me a lot in
my application
-----Original Message-----
The problem usually lies in the difference between the name of the subform
and the subform CONTROL on the main form. You never actually reference the
name of the subform, but rather the control on the mainform which holds the
subform. These may have different names and it is necessary to get the
right one. The general form is:

Forms!Form1!subControl1.Form!ControlOnSubform

Without knowing more about your system, I can't say any more.

On my website (see sig below) is a small sample database called
"SubformReference.mdb" which illustrates this and a lot of other things that
have to do with referencing subforms and subsubforms.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


Hello

I have sub_FormA in Form_A

When I enter [Forms]![Form_A]![sub_FormA]
Forms([Forms]![Form_A]![sub_FormA]
).AllowsAddition

I have the error:

Forms sub_FormA not found

What is the problem


.
 
Is your problem fixed? Or are you still having trouble? I can't really
tell. (Possibly a language barrier.)

I'm also not certain what you are trying to accomplish with your code. Can
you explain further?

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


George said:
Hi Roger,

I saw you example.

What I have:

Frm_Client and in this Form I have a Sub_Form: FrmAdresse
both are linked by the ClientID

the Sub_Form Name is FrmAdresse
the source is FrmAdresse

So I'm using the same terminologie

When I use Frm_Client in my Sub instead of Frm_Client!
FrmAdresse it will pass and I don't have any Problem

Besides, Thanks for your web site it's help me a lot in
my application
-----Original Message-----
The problem usually lies in the difference between the name of the subform
and the subform CONTROL on the main form. You never actually reference the
name of the subform, but rather the control on the mainform which holds the
subform. These may have different names and it is necessary to get the
right one. The general form is:

Forms!Form1!subControl1.Form!ControlOnSubform

Without knowing more about your system, I can't say any more.

On my website (see sig below) is a small sample database called
"SubformReference.mdb" which illustrates this and a lot of other things that
have to do with referencing subforms and subsubforms.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


Hello

I have sub_FormA in Form_A

When I enter [Forms]![Form_A]![sub_FormA]
Forms([Forms]![Form_A]![sub_FormA]
).AllowsAddition

I have the error:

Forms sub_FormA not found

What is the problem


.
 
Hello Roger

What I'm trying to do is a Sub that I have to use in 3
different places, instead of writting the same sub 3
times I prefer to write it in a module and to pass the
form name as parameter (StrFileName as string)
For example:

If in Frm_Client I change the country I have to stop the
user from adding in the FrmAdress so I have to use Allow
addition

The same if I change for example the phone number I have
to stop adding



-----Original Message-----
Is your problem fixed? Or are you still having trouble? I can't really
tell. (Possibly a language barrier.)

I'm also not certain what you are trying to accomplish with your code. Can
you explain further?

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


Hi Roger,

I saw you example.

What I have:

Frm_Client and in this Form I have a Sub_Form: FrmAdresse
both are linked by the ClientID

the Sub_Form Name is FrmAdresse
the source is FrmAdresse

So I'm using the same terminologie

When I use Frm_Client in my Sub instead of Frm_Client!
FrmAdresse it will pass and I don't have any Problem

Besides, Thanks for your web site it's help me a lot in
my application
-----Original Message-----
The problem usually lies in the difference between the name of the subform
and the subform CONTROL on the main form. You never actually reference the
name of the subform, but rather the control on the mainform which holds the
subform. These may have different names and it is necessary to get the
right one. The general form is:

Forms!Form1!subControl1.Form!ControlOnSubform

Without knowing more about your system, I can't say
any
more.
On my website (see sig below) is a small sample
database
called
"SubformReference.mdb" which illustrates this and a
lot
of other things that
have to do with referencing subforms and subsubforms.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


"George" <[email protected]> wrote
in
message
Hello

I have sub_FormA in Form_A

When I enter [Forms]![Form_A]![sub_FormA]
Forms([Forms]![Form_A]![sub_FormA]
).AllowsAddition

I have the error:

Forms sub_FormA not found

What is the problem


.


.
 
Back
Top