More explantion on subform

  • Thread starter Thread starter Frank Situmorang
  • Start date Start date
F

Frank Situmorang

Hello:

This statement is found on the property of " link masterfields:
Forms!Contacts!CallListSub!CallID

Can anyone explain to me the meaning of this Forms!....
Where can we have the explanation of the statements in a procedure/all
language of VBA

Thanks in advance
 
The use of Forms! means that you are referring to a form in the FORMS
collection. The name of the form comes after that.

So, if you have a form named frmTest and you are clicking a button on a form
named frmMain, the code to refer to control named txtName on that frmTest
form would be:

Forms!frmTest.txtName

To use it we would normally assign the value to it, or get the value, but
there are myriad things we could do with it.

If you are referring to a subform that is on another form, you would use

Forms!frmTest.YourSubformContainerNameHere.Form

The .Form there is telling Access we are talking about the form (subform)
which is housed in the subform container control (control on the main form
that houses the subform).

So, to refer to a control on the subform you would use

Forms!frmTest.YourSubformContainerNameHere.Form.txtMyControl

Now, that being said, you can also use this method to refer to the forms
collection:

Form("YourFormNameHere")
Which is essentially the same as saying Forms!YourFormNameHere

I hope that helps.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 
Thank you Bob, you help me very much in undestanding all this VBA. I will try
to solove my problem whiy my subform doesnot work
 
Bob:

In fact what I wanted to do is to make make churchmembership database is
like Contact database, the given of access sample.

I have a tab containing record, something like track records of the member,
so it is similar with the calls tab of contact sample. But it does not work
it says:
" The field 'Catatan.NO_URTANGT' can not contain a Null value because the
required property for this field is set to True, enter a value in this field.l

This field should be automatically filled because the Primary key in the
parent table 'bukuangkby' is an autonumber', For your info, this field is
already existing for the record that I tested because formerly our record was
in excelll an now I try to make our church membership into access.

Please help me on:
1. Why the error message occured
2. Why the field in the child table is not automatically field. Isn't if the
namefield is the same it will be automatically populated in the child table?

We appreciate your help.
 
If it is the primary key field then you might need to make sure that your
Child / Master links are set correctly and you might need to put a hidden
control with that on your subform. But, in reality you really shouldn't need
to if it is in the subform's recordsource.

--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 

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

Back
Top