Using Macro to enable/disable controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

My form is opened by clicking a swithchboard button (EDIT EXIST. RECORDS).
This activates a macro that opens the form in EDIT mode. The switchboard also
has another button called ADD NEW RECORD

My problem: I want a certain cmd button disabled when the form opens. This
"disable" should happen only when I am trying to "EDIT EXIST RECORDS".

I have tried setting the value of the control to ENABLE= FALSE, I have set
the focus to the control, etc but each time I get the error message " you
tried to run a VB procedure that improperly references a property or method
of an object.

Thanks,
 
ChessMaster,

In your macro that runs on the "EDIT EXIST RECORDS" button, you would
use a SetValue action. The arguments would be like this...
Item: [Forms]![NameOfForm]![NameOfControl].[Enabled]
Expression: No
 
Since I don't use macros, I don't know how this affect the problem and I am
not sure how you will know when the form opens which version (Add or Edit)
you are in unless you looking at the data entry property; however the correct
syntax is:

Me.ControlName.Enabled = False
 
Back
Top