button referencing

J

John

I am working with a tab control on a mainform and when I
click on certain tabs I need to have a button disabled.
The following is the last effort I tried. I placed this
in the OnClick event of the tab page. What am I missing
as it does not work? The button is on the mainform.

Mainform = usrfrmClaims
button = cmdusrfrmClientInformationAddNew
tab page = pagClientLocationInformation
tab control = TabCtl43

Forms!usrfrmClaims!
cmdusrfrmClientInformationAddNew.Enabled = False

Thanks in advance for assistance.
 
A

Allen Browne

Use the Change event of the tab control, to set the Visible property of the
button.

The Value of the tab control will be the same as the PageIndex property of
the page, so:

Me.cmdusrfrmClientInformationAddNew.Visible = _
Not (Me.TabCtl43.Value = Me.pagClientLocationInformation.PageIndex)
 

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

Similar Threads


Top