Altering recordsource on a subform

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

I am coding Access 2003 and I have a form with a dropdown control and a
subform on it. When the calue in the dropdown changes I want to update the
recordsource of the subform and requery it.

The problem is that the subforms recordsource is not exposed so that I can
alter it, neither is it's filter property.

How do you do this?

CL
 
You're probably looking at the properties of the subform *control* when you
need to be looking at the properties of the form that is the SourceObject of
the control ...

Private Sub Combo2_AfterUpdate()

Select Case Me.Combo2.Value
Case "one"
Me.MySubFormControl.Form.RecordSource = "SELECT * FROM Table1 WHERE
ID <= 5"
Case "two"
Me.MySubFormControl.Form.RecordSource = "SELECT * FROM Table1 WHERE
ID > 5"
End Select

End Sub
 
Thanks Brendan,

You hit my problem right oin the head, That fixed it.

I appreciate your help

CL
 
Back
Top