How do I refer to a subform in visual basic?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't know how to refer to a subform when coding using visual basic. I know
refering to a form requires "Forms!" but I need to know how to refer to a
subform
 
Thankyou for the website but I really am an amature at this, I haven't got a
clue what that page is talking about. I just want to know what to type if I
was to refer to a field name in a subform in visual basic. If it were a form
it would be
Forms![FormName].[FieldName] If it is a subform it would be.... what???
 
The website is explaining what to type if you refer to a field name in a subform in visual basic.

Let's call the main form frmMain. Let's call the subform subfrmManyRecords. It you want to refer to a field (ControlName) on the
subform (let's call it txtMyField) it would look like this:

Me!subfrmManyRecords.Form!txtMyField

Me! is a way to refer to the form you are coding in instead of having to type Forms!frmMain!.

To use the correct name of the subform, click on the subform object, open the properties box and look at the Name Property, not the
Source Object. They may be the same but you need to make sure. The same applies to the field -- the Name and the Control Source
may not be the same -- you must use whatever is in the Name property.

HTH,
Debbie

| Thankyou for the website but I really am an amature at this, I haven't got a
| clue what that page is talking about. I just want to know what to type if I
| was to refer to a field name in a subform in visual basic. If it were a form
| it would be
| Forms![FormName].[FieldName] If it is a subform it would be.... what???
 
Back
Top