SubForm Modify of "RecordSource" on User action on main form

S

shad

Hi
I would like to load in a query in the subform on action from the user. The
on action of the user is not an issue, the modification to the subform for it
to accept a string into the property Record Source is however. The code I
have is as below

[Forms]![frmCards]![frmCardsubform].[RecordSource] = "Query4"
frmCards is main form, frmCardsubform is subform in frmCards

I am using "Query4" for just as test case, will use more complex quires
depedant on operator slection once I get the simple case working.

The error I get is "Object doesen't support this property or method"

Would very much apprciate any hint/input.
Shad
 
M

Marshall Barton

shad said:
I would like to load in a query in the subform on action from the user. The
on action of the user is not an issue, the modification to the subform for it
to accept a string into the property Record Source is however. The code I
have is as below

[Forms]![frmCards]![frmCardsubform].[RecordSource] = "Query4"
frmCards is main form, frmCardsubform is subform in frmCards

I am using "Query4" for just as test case, will use more complex quires
depedant on operator slection once I get the simple case working.

The error I get is "Object doesen't support this property or method"


Right. You're trying to set the record source of the
subform control instead of the form it's displaying.

Me.frmCardsubform.FORM.RecordSource = "Query4"
 

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