[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Hide/Unhide command buttton

Posted on 2008-10-02
3
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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 31

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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

656 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