Solved

Hide/Unhide command buttton

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

789 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