SubForm - Setting The Rowsource

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

Guest

I am trying to set the RowSource on a SubForm using Dynamic SQL, then to
requery it. I keep getting Application/Object Error. Why?

The code used is:

MsgBox Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form!lblCol3
Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form.RowSource = strSQL
Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form.Requery

based on:

To refer to a control on a subform, use the following syntax:

Forms![main form name]![subform control name].Form![control name]
To refer to a control on a subreport, use the following syntax:
Reports![main report name]![subreport control name].Report![control name]
 
Patrick said:
I am trying to set the RowSource on a SubForm using Dynamic SQL, then to
requery it. I keep getting Application/Object Error. Why?

The code used is:

MsgBox Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form!lblCol3
Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form.RowSource = strSQL
Forms![frmServiceCreditv2].[sfrmServiceDetailsSubForm].Form.Requery

based on:

To refer to a control on a subform, use the following syntax:

Forms![main form name]![subform control name].Form![control name]
To refer to a control on a subreport, use the following syntax:
Reports![main report name]![subreport control name].Report![control name]


Your syntax is fine. The problem seems to be that doem
object do not have a RowSource property. perhaps you want
to use the RecordSource property??
 
Back
Top