Results 1 to 4 of 4
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Filter/Change continuous form with a button

    I have a form with two buttons that I would like to have change the continuous form that they are on from one of two options.

    One button needs to update the view to show performances with feedback where as the other needs to show without when they are clicked.

    Any suggestions on how to do this?



    Click image for larger version. 

Name:	Capture.JPG 
Views:	12 
Size:	22.8 KB 
ID:	13836

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Here's some sample code to place behind your Command Buttons; replace all Button Names/Field Names with your actual names:
    Code:
    Private Sub btnWithFeedback_Click()
      Me.Filter = "Not Isnull([Feedback])"
      Me.FilterOn = True
    End Sub
    
    Private Sub btnWithoutFeedback_Click()
      Me.Filter = "Isnull([Feedback])"
      Me.FilterOn = True
    End Sub

    And if you want a button to restore the Form to its Non-Filtered state:
    Code:
    Private Sub btnWithoutFilter_Click()
      Me.Filter = ""
      Me.FilterOn = False
    End Sub

    Linq ;0)>

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by Missinglinq View Post
    Here's some sample code to place behind your Command Buttons; replace all Button Names/Field Names with your actual names:
    Code:
    Private Sub btnWithFeedback_Click()
      Me.Filter = "Not Isnull([Feedback])"
      Me.FilterOn = True
    End Sub
    
    Private Sub btnWithoutFeedback_Click()
      Me.Filter = "Isnull([Feedback])"
      Me.FilterOn = True
    End Sub

    And if you want a button to restore the Form to its Non-Filtered state:
    Code:
    Private Sub btnWithoutFilter_Click()
      Me.Filter = ""
      Me.FilterOn = False
    End Sub

    Linq ;0)>
    Thanks - works!

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-10-2013, 07:34 PM
  2. Continuous Form Button
    By swalsh84 in forum Forms
    Replies: 2
    Last Post: 07-12-2012, 12:13 PM
  3. Replies: 1
    Last Post: 11-24-2011, 07:45 AM
  4. Filter a Continuous Form
    By michel_annie22 in forum Forms
    Replies: 7
    Last Post: 11-09-2011, 07:34 AM
  5. Replies: 2
    Last Post: 04-12-2011, 08:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums