accessing data on a subform...

B

Brad Pears

I can not find the sytax for accessing subform data. I thought it was like
this...

strText = forms![MainFormName]![SubFormName].[Field1] but this doens;t
seem to work....

Can some one help me?


Thanks,

Brad
 
W

Wayne Morgan

Replace SubFormName with:

NameOfSubformControl.Form

The NameOfSubformControl is the name of the control on the main form that
holds the subform. To get the name of this control, open the main form in
design mode, open the Properties sheet, click on the subform ONE time. The
Properties sheet should show the name of the subform control. If you click
on the subform a second time, you'll be in the subform and the Properties
sheet will show the name of the subform, not the control holding it.
 
B

Brad Pears

Still having problems with the syntax....

The subform control name is child-issues... So to access the field "field1"
on this subform how would I write the reference?

forms![frmMain]![child-issues.form].[Field1] ????

Thanks,

Brad

Wayne Morgan said:
Replace SubFormName with:

NameOfSubformControl.Form

The NameOfSubformControl is the name of the control on the main form that
holds the subform. To get the name of this control, open the main form in
design mode, open the Properties sheet, click on the subform ONE time. The
Properties sheet should show the name of the subform control. If you click
on the subform a second time, you'll be in the subform and the Properties
sheet will show the name of the subform, not the control holding it.

--
Wayne Morgan
MS Access MVP


Brad Pears said:
I can not find the sytax for accessing subform data. I thought it was like
this...

strText = forms![MainFormName]![SubFormName].[Field1] but this doens;t
seem to work....

Can some one help me?


Thanks,

Brad
 

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

Top