Disabling a Macro from If Statement

  • Thread starter Musa via AccessMonster.com
  • Start date
M

Musa via AccessMonster.com

I have the following code in an Event Procedure (On_ClicK). Command133 is a
Macro that calls upon the next form(while closing the current form). This
should be disabled as long as any of the option groups = -1. The problem I
have is the enable and disable of the Macro (Command133).
I want to Disable Command133 while the individual is completing all the
fileds on the form and then Enable Command133 after all Options have been
competed.

Private Sub Command176_Click()
If (Me.Combo156) And (Me.opt41) And (Me.opt42) And (Me.opt43) And (Me.opt44)
And (Me.opt45) And (Me.Frame46) = -1 Then
Me.Command133.Enabled = False
MsgBox "You missed a Question. Please check your selections"
Cancel = True
Else
Me.Command133.Enabled = True
MsgBox "You may proceed to the next page"
Exit Sub
End If
End Sub
 

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

Top