T
T Ray Humphrey
This is related to another problem I posted about regarding setting
RecordSource programmatically, but it deserved a new thread.
I have a dynamic form hierarchy where a choice made in the Main form
determines which form to load in a subform object. At runtime, I need to set
two properties:
subform.SourceObject to load the form
subform.Form.RecordSource to filter the records.
When SourceObject is set, Access loads the form and generates a series of
events including Load and Current. Then when RecordSource is set, Access
generates another series of events including Current.
Is there a way to get only one Current event to run?
In the form, I have set the designtime RecordSource to "", but Access still
calls my Current event when I set subform.SourceObject. This generates an
error because I reference a field (Me!fldname) that is not found.
Must I check in Current to see if RecordSource is set before I process
anything?
Is there a better way to do this?
Thanks,
Ray
RecordSource programmatically, but it deserved a new thread.
I have a dynamic form hierarchy where a choice made in the Main form
determines which form to load in a subform object. At runtime, I need to set
two properties:
subform.SourceObject to load the form
subform.Form.RecordSource to filter the records.
When SourceObject is set, Access loads the form and generates a series of
events including Load and Current. Then when RecordSource is set, Access
generates another series of events including Current.
Is there a way to get only one Current event to run?
In the form, I have set the designtime RecordSource to "", but Access still
calls my Current event when I set subform.SourceObject. This generates an
error because I reference a field (Me!fldname) that is not found.
Must I check in Current to see if RecordSource is set before I process
anything?
Is there a better way to do this?
Thanks,
Ray