Locked Fields and Toggle Button

gry086

New member
Local time
Today, 09:27
Joined
May 4, 2011
Messages
7
Hi, I'm new here.

I have built a multiform. It has a field called "account" which I want a toggle button to lock.

To achieve this I inserted a button in the form header.
I have chosen Events tab -->ON Click -->Event Procedure
In this VB dialog I wrote:
Private Sub Command14_Click()
Me.account.Enabled = False
End Sub


Why does this not work?
 
Is account, in fact, the name of the Control?

If you're using Access 2007/2010 code will not execute unless the file resides in a folder that has been declared 'trusted.' Do you have any VBA code that executes?

Linq ;0)>
 
First off - you disable and enable CONTROLS on the form and not fields. Fields are found within tables, queries, and the recordset of the form returned by a table or query that the form is bound to.

Second, because of that, if the control name isn't the same as the field name (and since it isn't working for you, I will assume it is not), you must use the control name and not the field name for disabling.

And when you say Multiform - what does that mean? Is it a main form with a subform? If so, is ACCOUNT on the subform and the button on the main form? If so, you would need different syntax.
 
@ missinglinq : You completely nailed it, my Access trust center settings did not include my working directory. Thank you both
 

Users who are viewing this thread

Back
Top Bottom