Re: reference a nested subform control in the subform

alicejwz

Registered User.
Local time
Today, 08:30
Joined
Jul 9, 2003
Messages
91
Re: reference a nested subform control in the subform

Hi,

How do you reference to a control in nested subform within the subform?
The following code is being run in subform and gives me an error.

If Me!RMR_desc_defects_subform.Form!num_defects.Value <> Null Then
:
end if

Error:MS VB
The expression you entered has a field, control, or property name that MS Access can't find.

I would appreciate your help.
 
Are you sure it is the reference to the control? I don't think you could check for Null value this way. Use the

If IsNull(MyControl)=False Then ...... End If

function instead.

hth.
SWK
 
SunWuKung is correct on testing for Null, and your reference looks correct if RMR_desc_defects_subform is the subform control name, which may differ from the subform name as viewed in the database window. When referencing subform controls, it is the subform control name which is used.

Easiest way of obtaining the correct subform control name, is to enter the expression builder (for instance from a controlsource of the subform you are calling this from). Then doubleclick thru forms, loaded forms, main form, subform1, subform2, then the control. This should give you the correct subform control name which is used when referencing. See for instance

http://support.microsoft.com/?kbid=209099

for more information
 

Users who are viewing this thread

Back
Top Bottom