Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msgbox comes up 3 times, why?

Status
Not open for further replies.

NewTexican

Technical User
Dec 10, 2004
95
US
I have =checkboxclick in the onclick for my checkbox.

I get the msgbox 3 times????

Public Sub checkboxclick()

Dim mloutyn As Boolean

mloutyn = Screen.ActiveControl.Value

MsgBox mloutyn

End Sub
 
Is that the only code on your form?
My guess is something else is causing this.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
I turned off my oncurrent and onload code. So it's not in this code, or a funny quirk that you know of? surprise surprise.
 
Is this what the actual code looks like?

Code:
Private Sub chkBoxName_Click()
  Call checkboxclick
End Sub


Public Sub checkboxclick()
      
    Dim mloutyn As Boolean
        
    mloutyn = Screen.ActiveControl.Value
    
    MsgBox mloutyn
       
End Sub

Or is there more code involved in the chkBoxName_Click event?

Did you try moving the call to the AfterUpdate event of the check box?

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
If I make the code look like that and then put [event procedure] in the on click line of the checkbox form design view, it works well. If I put =checkboxclick into the onclick line from design view I get 3 messageboxes. I guess I'll just stick with your code. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top