Disable All Fields

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

Guest

Is it possible to diasable all Fields within a form once a toggle button has
been pressed.
 
You could set the AllowEdits (and AllowDeletions?) property of the form to
No in the AfterUpdate event of the toggle button.

If the button is bound to a field, you probably want to do the same thing in
the Current event of the form.
 
hi,
yes.
dim cntrl as control
for each cntrl in me.controls
if me.togglebutton1 = true
cntrl.enabled = false
else
if me.togglebutton1 = false
cntrl.enabled = true
end if
end if
next cntrl

this snipplet with disable all control on your form(textbox, combobox ect)
with the toggle is checked. i enables all controls when you uncheck. If You
diable a control, you must have a way to enable it.
i would put it in the togglebutton's click event.

Regards

FSt1
 
I have typed this in

Private Sub Toggle265_AfterUpdate()

Dim cntrl As Control
For Each cntrl In Me.Controls
If Me.Toggle265 = True Then
cntrl.Enabled = False
Else
If Me.Toggle265 = False Then
cntrl.Enabled = True
End If
End If
Next cntrl

End Sub

But it keeps on coming up with a error -

Run-time error '438':

Object doesn't support this property or method.

(cntrl.Enabled = True)
 

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

disable button based on value 2
Disabling A Text Box On A Form 4
Toggle button vs Command button 2
Enabling A Button 3
Toggle buttons on toolbar 1
DRM In Vista 7
access form using toggles 5
refresh button 1

Back
Top