Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting RecordSource in Subdatasheet

Status
Not open for further replies.

pdurrer

Programmer
Feb 15, 2002
4
US
I'm stumped.

I have a combo-box on a form that lets a user select a database. Once selected, a datasheet contained in a subform is displayed which shows a list of all user groups within that database. Within this datasheet is a subform containing another datasheet, which is used to display users within that group.

The RecordSource must be altered programmatically in both datasheets whenever the user changes the database combo-box. I'm able to alter the recordsource in the Groups datasheet using a subprogram in the groups form, and calling it as follows:

Call Me.Controls.Item("Groups").Form.SetRecordSource(cboDatabaseName.Value)

This works fine. However, when I try to change the recordsource for the user subdatasheet (using a similar procedure in the "Users" form), I receive a message. Here's the call:

Call Me.Controls.Item("Groups").Form.Controls.Item("Users").Form.SetRecordSource(cboDatabaseName.Value)

And here the error, which is only received on a sporadic basis:

"Run-time Error 2455: You entered an expression that has an invalid reference to the property Form/Report".

Any ideas?

Thanks,
Preston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top