B
Brad Pears
I have a mainform on which is a subform. I use the .sourceobject property to
change the sourceobject of the subform to display various forms within the
subfoirm container...
If I hard code the form name as shown below the statement works no problem.
However, I want to use a database field name (so I can make a generic
function to load the correct form) and I get the following error...
"The setting you entered isn't valid for this property."
Here is the code that works...
Forms![frmPricing].[frmPricingDetail].SourceObject = "frmFormName"
Here is the code that fails...
' RS!FormToLoad comes from a table containing the form name...
strFormToLoad = & """" & RS!FormToLoad & """"
Forms![frmPricing].[frmPricingDetail].SourceObject = strFormToLoad
Can anyone help me with this ?
Thanks,
Brad
change the sourceobject of the subform to display various forms within the
subfoirm container...
If I hard code the form name as shown below the statement works no problem.
However, I want to use a database field name (so I can make a generic
function to load the correct form) and I get the following error...
"The setting you entered isn't valid for this property."
Here is the code that works...
Forms![frmPricing].[frmPricingDetail].SourceObject = "frmFormName"
Here is the code that fails...
' RS!FormToLoad comes from a table containing the form name...
strFormToLoad = & """" & RS!FormToLoad & """"
Forms![frmPricing].[frmPricingDetail].SourceObject = strFormToLoad
Can anyone help me with this ?
Thanks,
Brad