Solved

Hide/Unhide command buttton

Posted on 2008-10-02
3
261 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 119

Expert Comment

by:Rey Obrero
Comment Utility

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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
<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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now