Defining a checkbox as a variable

eme126

Registered User.
Local time
Today, 15:59
Joined
Jun 2, 2006
Messages
45
Hello all,

I was wondering what should I define a chechbox as if I want to make it a variable, so that when it is checked (= -1), I can check for the -1 and loop somewhere.

Thanks
 
You can check the checkbox directly (I.E. Me.MyCheckbox = true)
But if you need to put it in a variable, dim the variable as boolean
 
Thanks Fofa, that will help a lot. I was just wondering what does the "Me" identifier do?
 
"Me" when referenced from a FORM, means THAT FORM, or ME. So instead of writing a from reference like: Forms!Myform!Mycontrol, it can be written as Me.MyControl. Limitation is it can only reference the current form. If you are referencing a different form, you need to use the long version. So if you wanted to set a text box on the current form, to a value on another form (open but not current, or not in focus) then it would be Me.MyTextBox = Forms!MyOtherForm!MyOtherTextBox as an example
 
Issues with the code

Fofa,
Do you see anything obviously wrong in the code: Thanks ahead

Private Sub CheckInterM_Click()

Dim CheckInterM As Boolean

'If the check box is checked, the corresponding spec should be sent to the new form

If Me.CheckInternM = -1 Then
Print [CheckInternM.Value] 'Me.MyTextBox = Forms!MyOtherForm!MyOtherTextBox
End If

Debug.Print ["hello"]

'DoCmd.OpenQuery "100 Query"


End Sub
 

Users who are viewing this thread

Back
Top Bottom