I'M NEW TO VISUAL BASIC, I HAVE A FORM WITH 12 CHECK BOXES NUMBERED 1 - 12 I NEED A RESULT BOX TO DISPLAY WHICH NUMBERS I HAVE CLICKED AND A WAY TO STORE THESE RESULTS CAN SOMEONE HELP ME
Printable View
I'M NEW TO VISUAL BASIC, I HAVE A FORM WITH 12 CHECK BOXES NUMBERED 1 - 12 I NEED A RESULT BOX TO DISPLAY WHICH NUMBERS I HAVE CLICKED AND A WAY TO STORE THESE RESULTS CAN SOMEONE HELP ME
private Sub cmdResults_Click()
Dim oControl as Control
Dim sResult as string
for Each oControl In Controls
If TypeOf oControl is CheckBox then
If oControl.Value then sResult = sResult & ", " & oControl.Name
End If
next
MsgBox "You Checked; " & mid$(sResult, 3)
End Sub
You could store the Result(s) in the Registry using the VB Functions GetSetting() and SaveSetting()
Aaron Young
Analyst Programmer
[email protected]
[email protected]