Disabling Buttons (1 Viewer)

Mcgrco

Registered User.
Local time
Today, 23:26
Joined
Jun 19, 2001
Messages
118
Im looking for a piece of code that I can call at anytime to disable buttons

I dont wast to have to put the code below each time but Im fairly new to codeing. can anyone give me an example so I can get started. i want to be able to say buttonStatus = Off to replace the below


Thanks
Forms![frm_Main]![CmdMEMissMatch].Enabled = False
Forms![frm_Main]![CmdFarrsMonthEnd].Enabled = False
Forms![frm_Main]![CmdSetDate].Enabled = False
Forms![frm_Main]![CmdAllMacros].Enabled = False
Forms![frm_Main]![CmdFrmGraphs].Enabled = False
Forms![frm_Main]![CmdFrmReportList].Enabled = False
Forms![frm_Main]![CmdFrmMacrolist].Enabled = False
Forms![frm_Main]![CmdPositions].Enabled = False
 
M

mjbtx

Guest
You could easily make this into a function and call it in your code whenever you want to turn the buttons off. Create a new module and use something similar to below. Here is a quick example without any error-trapping.

'*******************************************

Public Function ButtonOff

Forms![frm_Main]![CmdMEMissMatch].Enabled = False
Forms![frm_Main]![CmdFarrsMonthEnd].Enabled = False
Forms![frm_Main]![CmdSetDate].Enabled = False
Forms![frm_Main]![CmdAllMacros].Enabled = False
Forms![frm_Main]![CmdFrmGraphs].Enabled = False
Forms![frm_Main]![CmdFrmReportList].Enabled = False
Forms![frm_Main]![CmdFrmMacrolist].Enabled = False
Forms![frm_Main]![CmdPositions].Enabled = False

End Function

'*******************************************

To call this function, just use Call ButtonOff as a line in your code.

[This message has been edited by mjbtx (edited 01-14-2002).]

[This message has been edited by mjbtx (edited 01-14-2002).]
 

Mcgrco

Registered User.
Local time
Today, 23:26
Joined
Jun 19, 2001
Messages
118
thanks
 

Users who are viewing this thread

Top Bottom