Return string from checkboxes (1 Viewer)

ITintern34744

New member
Local time
Yesterday, 21:35
Joined
Aug 20, 2015
Messages
1
I have a checkbox and I would like to return a value, for example "male" or "female" instead of 0 or -1. I have tried a few solutions and my checkbox is named Sat. Here is my first attempt:

Private Sub Sat_Click()
Dim strSelction As String
strSelction = ""


If Me.Sat = True Then
strSelection = strSelection & "Sat;"


End If
End Sub


Here is my second attempt:


Private Sub Sat_Click()
Dim strSelction As String
strSelction = ""


If Me.Sat = True Then
Sat.Controls.Item(0).Caption


End If
End Sub

Thank you.
 

plog

Banishment Pending
Local time
Yesterday, 20:35
Joined
May 11, 2011
Messages
11,658
My genius level deduction abilities can only take me so far: I'm able to surmise that you are posting on here because you are facing an issue you need help with. What that issue is though--only a vague idea.

Are you getting an error message? Unexpected results? When you run the code is it causing unsafe levels of radiation in your office? Give us what exactly is or isn't occuring and what your specific expectations are.

With that addressed, you said you want to return a value. A Sub does not return a value, only a function:


Code:
Function sampleFunction()

sampleFunction=1
End Function
 

Users who are viewing this thread

Top Bottom