Button not visible

chrisguk

Registered User.
Local time
Yesterday, 20:39
Joined
Mar 9, 2011
Messages
148
Hi all,

I have a form that provides function to two areas. Therefore some of my command buttons have no relation to one of the forms. For example

frmSitesMain = command button not visible

frmSitesCRCMain = command button visible

How would I achieve this?
 
Just set the visible property to True or False as you require.
 
Just set the visible property to True or False as you require.

Hi Thanks for the reply.

If I explain further apologies for not making it clear.

frmSitesMain has a subform called frmSitesAccount

frmSitesCRCMain shares the same subform frmSitesAccount

The cmd button will be located on the frmSitesAccount (subform)

So im trying to find a way for the on open or activivate or load function to say:

If the main form is frmSitesMain then = NOT VISIBLE

if the main form is frmSitesCRCMain then = VISIBLE
 
Hi Thanks for the reply.

If I explain further apologies for not making it clear.

frmSitesMain has a subform called frmSitesAccount

frmSitesCRCMain shares the same subform frmSitesAccount

The cmd button will be located on the frmSitesAccount (subform)

So im trying to find a way for the on open or activivate or load function to say:

If the main form is frmSitesMain then = NOT VISIBLE

if the main form is frmSitesCRCMain then = VISIBLE

This should do it for you - put it in the On Load event of the subform:

Code:
Dim blnShow As Boolean
 
Select Case Me.Parent.Name
   Case "frmSitesMain"
       blnShow = False
   Case "frmSitesCRCMain"
       blnShow = True
   Case Else
       Msgbox "This item has not been set up yet for this parent form." & vbCrLf & _
       "Please notify your database administrator", vbInformation, "PutModuleAndProcedureNameHere"
End Select
 
Me.ButtonNameHere.Visible = blnShow
 

Users who are viewing this thread

Back
Top Bottom