Solved

Hide/Unhide command buttton

Posted on 2008-10-02
3
264 Views
Last Modified: 2013-11-28
Ok, I know this question has been posted before, but I need some help with this as the solution doesn't work on my problem.
Can anyone tell me what wrong with this code???
Private Sub cmdFilter_Click()
    Me.Filter = "Sold=True"
    Me.cmdUnFilter.Visible = True
End Sub

Private Sub cmdUnFilter_Click()
    Me.Filter = "Sold=False"
    Me.cmdUnFilter.Visible = False
End Sub

The UnFilter button is set to visible = no

Ian Wells
0
Comment
Question by:irwells
  • 2
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22629988

Private Sub cmdFilter_Click()
    Me.Filter = (Sold=True)
    Me.cmdUnFilter.Visible = True
End Sub

Private Sub cmdUnFilter_Click()
    Me.Filter = (Sold=False)
    Me.cmdUnFilter.Visible = False
End Sub
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 22630030
you can not set the visible property of a control that has the focus


Private Sub cmdFilter_Click()
    Me.Filter = (Sold=True)
    Me.cmdUnFilter.Visible = True
End Sub

Private Sub cmdUnFilter_Click()
    Me.Filter = (Sold=False)
    me.cmdFilter.setfocus                    'add this line
    Me.cmdUnFilter.Visible = False
End Sub
0
 
LVL 30

Expert Comment

by:hnasr
ID: 22630844
<Can anyone tell me what wrong with this code???>
If I compare it with what you want to achieve.
You want to filter for sold=true and hide button that says filter.
Then you want to unfilter, means sold = true/false (all records) then hide button Unfilter.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question