C
Chaplain Doug
I have a form with two subforms on it. When a record is
selected in one subform, the RecordSource is updated in
the other to reflect the records associated with the
selected record. I do this in the OnCurrent event:
Private Sub Form_Current()
Dim strSQL As String
strSQL = "SELECT * FROM [Male Progress Query] " & _
" WHERE [StudentID] = " & Me.StudentID
Forms![Male Program Records]![Male Progress
subform2].Form.RecordSource = strSQL
Forms![Male Program Records]![Male Progress
subform2].Visible = True
End Sub
When I first open the main form the assignment to
RecordSource fails (because I suspect that the seconf
subform is not yet open). However, once all forms are up
the assignment works. Should I do this in another way?
Or how do I detect that the second subform is not open
before I try to set the RecordSource? Thanks.
selected in one subform, the RecordSource is updated in
the other to reflect the records associated with the
selected record. I do this in the OnCurrent event:
Private Sub Form_Current()
Dim strSQL As String
strSQL = "SELECT * FROM [Male Progress Query] " & _
" WHERE [StudentID] = " & Me.StudentID
Forms![Male Program Records]![Male Progress
subform2].Form.RecordSource = strSQL
Forms![Male Program Records]![Male Progress
subform2].Visible = True
End Sub
When I first open the main form the assignment to
RecordSource fails (because I suspect that the seconf
subform is not yet open). However, once all forms are up
the assignment works. Should I do this in another way?
Or how do I detect that the second subform is not open
before I try to set the RecordSource? Thanks.