Event to set Record Source of SubForm

  • Thread starter Thread starter Sandy
  • Start date Start date
Sorry - I figured it out. I created the queries I wanted then programmed 2
buttons to apply the SQL to my record source as follows:

Private Sub ShowAllBut_Click()

Dim stFilterSQL As String
stFilterSQL = "the SQL view of my query here"
Me.RecordSource = stFilterSQL
Me.Requery
End Sub

Sorry for the bother!
 
Sandy said:
Sorry - I figured it out. I created the queries I wanted then programmed 2
buttons to apply the SQL to my record source as follows:

Private Sub ShowAllBut_Click()

Dim stFilterSQL As String
stFilterSQL = "the SQL view of my query here"
Me.RecordSource = stFilterSQL
Me.Requery
End Sub


That's good.

Just one comment though. Using Requery here is a waste of
processing because setting the RecordSource automatically
takes care of that.
 
Back
Top