Change recordsource of subfrm to another saved query OnOpen

MsLady

Traumatized by Access
Local time
Today, 03:15
Joined
Jun 14, 2004
Messages
438
How do i make my subfrm record source switch to another saved query (qryPendingStatus) when it's opened from the form.

Heres what i am trying to accomplish:
I have a subfrm that i'd like to use to display info in 2 different forms.

There's a form currently for All statuses. Then another new one for Pending status. I'd like to use the same subform for this pending status form also, and in doing that my qryAllStatuses, but change to qryPendingStatus on the subfrm when i open the mainfrom.

This is on the open even ofthe mainform, but does not work (says method not founds...so obviouly i can't use ".Recordsource" here:
Code:
Private Sub Form_Open(Cancel As Integer)
Me.subfrmJobInfo.RecordSource = "qryPendingStatus"
End Sub

How can i make this happen?
 
Me.subfrmJobInfo.Form.RecordSource = "qryPendingStatus"
 
RuralGuy said:
Me.subfrmJobInfo.Form.RecordSource = "qryPendingStatus"

GREAT!! This does it. Thanks buddy
hug.gif
 

Users who are viewing this thread

Back
Top Bottom