Navigation button make it not visible

A

Alex Martinez

Hi,

Hi,

I have a form that has a tab control in it. The first tab is called Form
View and has many text boxes with the standard navigation button. The
second tab
called Datasheet view has a subform. The second tab will give me a datasheet
with the navigation buttons. My problem is I want to have the standard form
navigation button not be visible when I click the Datasheet View and later
be visible when I click the Form Vew tab. The datasheet already has a
navigation button.and I don't want to confuse the user. Any tips will be
appreciated. Thank you.
 
T

tina

Alex, i already gave you a simple coding solution after you posted this
question last night (8/5/2005 9:31 pm) in newsgroup
microsoft.public.access.forms. did you try the solution? if it didn't work,
what problem did you encounter?
 
A

Alex Martinez

Tina

The sample you give me worked fine in my earlier posting, now I just wanted
to have the standard navigation button disappear when the user click on the
datasheet view. The datasheet view has a navigation button already built
in. Unfortunaely I don't know the code and believe me I tried. Thanks
 
T

tina

sorry, i misunderstood your question. easy answer: just add to the code i
gave you earlier, as

Private Sub TabCtl10_Change()

With Me
!cmdAdd.Visible = Not (!TabCtl10 = 1)
!cmdUndo.Visible = Not (!TabCtl10 = 1)
!cmdDelete.Visible = Not (!TabCtl10 = 1)
.NavigationButtons = Not (!TabCtl10 = 1)
End With

End Sub

though at this point i might run the equation only once, and assign it to a
variable, rather than running it four times. so the code would look like

Private Sub TabCtl10_Change()

Dim blnSetting As Boolean
blnSetting = Not (!TabCtl10 = 1)
With Me
!cmdAdd.Visible = blnSetting
!cmdUndo.Visible = blnSetting
!cmdDelete.Visible = blnSetting
.NavigationButtons = blnSetting
End With

End Sub

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top