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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Visible why error 1

Status
Not open for further replies.

ralphus

Technical User
Dec 30, 2004
28
GB
when using .visibe = false
on the button itself after perfrming an action does it complain:

Private Sub btn_edit_Click()
btn_site_save.Visible = True
btn_site_delete.Visible = True
btn_add_site.Visible = True
btn_edit.Visible = False
End Sub

its not happy with the bit in bold is it beacause i can't call that from within itself
 
Hi,

The code you supplied should work fine. I have tested it on my machine and it works how i think you are expecting it to.

Cheers

Harleyquinn

---------------------------------
For tsunami relief donations
 
Hi,

It won't work in MS Access you will get an error saying that you can't hide a control with focus.

If this is the case you can get around this by setting focus to another control before you make it invisible e.g.

Code:
Private Sub btn_edit_Click()
btn_site_save.Visible = True
btn_site_delete.Visible = True
btn_add_site.Visible = True
btn_add_site.SetFocus
btn_edit.Visible = False
End Sub

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Cheers Harleyquinn
Great many thanks
Ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top