?
Solved

Hide/Unhide command buttton

Posted on 2008-10-02
3
Medium Priority
?
269 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 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

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.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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