Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Look of a button

Status
Not open for further replies.

Chris1977

Technical User
Feb 2, 2003
50
US
This is most likely a simple question for those that have used Access for a while but here goes.

I what to make a button appear depressed when clicked and normal when slicked again.

I have a button now that filters records by a field on that form and just what ensure they now they clicked the button.

Here is the code I have now which works and makes the button text turn red when depressed and black when not clicked.

FilterOn = False
If FCounter = 0 Then
Filter = "SupervisorID = " & Me!SupervisorID.Value
Me.cmdFilterAgentData.ForeColor = 255
FilterOn = True
FCounter = 1
Exit Sub
End If
FCounter = 0
Me.cmdFilterAgentData.ForeColor = 0
 
If I understand what you want to do, one way to make this command button "look" like a toggle button (in when 'active', out when 'inactive"') is to use a real command button that's transparent, over top of a rectangle that looks just like a button. Then you can change the rectangle's SpecialEffect property to make the rectangle look sunken (2) or raised (1), e.g.

Me.Rectangle.SpecialEffect = 2


Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top