Running a Macro from Form View

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • c stoddart

    Running a Macro from Form View

    Access 2003 Form view _ Using a check Box to return a 5 in a text box. The check box runs a macro
    Code:
    "Private" Sub Check0_Click()  
          If Me. Check0 [= -1] Then  
                Me. Text4 [=+5]
          Else 
                  Me. Text4  ""
          End If
    End Sub
    I get a msg wrong syntax
    using an operand without an operator
    Last edited by MMcCarthy; Oct 15 '10, 05:51 AM. Reason: adding code tags
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Not sure what you are trying to do but your code should look like this ...

    Code:
    Private Sub Check0_Click()  
        If Me.Check0 = -1 Then  
            Me.Text4 = 5
        Else 
            Me.Text4 = ""
        End If
    End Sub

    Comment

    • c stoddart

      #3
      Thanks, no help. Thanks for your time.

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        If you give a little more information maybe we could help.

        Comment

        • c stoddart

          #5
          I am trying to run a risk assesment to decide on an audit. Do I use a mailout or onsite. I would like to use a number. The check boxes (5ea)will create a number in the text box. Depending on the final number will determine the action. I need 3 check boxes to be "or" "This one "or" that". Then 3 check boxes will be "Added" to the first boxs' checked.

          Comment

          Working...