Changing RecordSource of a subform

G

Guest

Is there a way to change the RecordSource of a form that is used in a subform?

I have a subform (Total Fees subform) that uses a form (Total Fees) as its
SourceObject. How do I change the RecordSource of that form?

I tried the below but get the error: Microsoft can’t find the field ‘total
Fees’ referred toin your expression

Forms![Indvl Entries]![Total Fees subform]![Total Fees].RecordSource = "qry
Indv Fee Sums"
 
K

Ken Snell \(MVP\)

General syntax:
Forms!SubformName.Form.RecordSoiurce = "String"

where SubformName is the name of the subform control (the control that holds
the source object). So for your specific case:

Forms![Indvl Entries]![Total Fees subform].Form.RecordSource = "qry Indv Fee
Sums"


I assume that you want to do this from the main form's programming? Assuming
this, this is an easier way to do this:

Me.[Total Fees subform].Form.RecordSource = "qry Indv Fee Sums"
 
G

Guest

That worked. Thanks much. Yes, I know about "Me" but thanks for reminding me.

Steve
Ken Snell (MVP) said:
General syntax:
Forms!SubformName.Form.RecordSoiurce = "String"

where SubformName is the name of the subform control (the control that holds
the source object). So for your specific case:

Forms![Indvl Entries]![Total Fees subform].Form.RecordSource = "qry Indv Fee
Sums"


I assume that you want to do this from the main form's programming? Assuming
this, this is an easier way to do this:

Me.[Total Fees subform].Form.RecordSource = "qry Indv Fee Sums"

--

Ken Snell
<MS ACCESS MVP>


Steve S said:
Is there a way to change the RecordSource of a form that is used in a
subform?

I have a subform (Total Fees subform) that uses a form (Total Fees) as its
SourceObject. How do I change the RecordSource of that form?

I tried the below but get the error: Microsoft can't find the field
'total
Fees' referred toin your expression

Forms![Indvl Entries]![Total Fees subform]![Total Fees].RecordSource =
"qry
Indv Fee Sums"
 

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