filter on, filter off

  • Thread starter Thread starter Christopher Glaeser
  • Start date Start date
C

Christopher Glaeser

WorkOrders can be "Open" or "Closed". How do I add two command buttons to a
form that will a) show all WorkOrders, and b) show only open WorkOrders? I
created the two queries and added the two command buttons that reference
them, but when clicked, the query result table is displayed. How do I make
these command buttons change the records available in the form?

Best,
Christopher
 
Use the Click event of the button to set the RecordSource of the form.

It's a good idea to check whether the record is dirty first (i.e. needs to
be saved).

Private Sub cmdClosed_Click()
If Me.Dirty Then Me.Dirty = False
Me.RecordSource = "NameOfYourQueryHere"
End Sub
 
Back
Top