Return string from checkboxes

teel73

Registered User.
Local time
Today, 01:59
Joined
Jun 26, 2007
Messages
205
Hi everyone ..

I can't figure out a way to accomplish this task. Hopefully someone can help me.. here goes:

I have a form with 6 unbound checkboxes named (computer,laptop,blackberry) and 1 command button called "submit".

This form is used to request the above mentioned technology.

Whichever checkboxes are checked, when the user clicks "submit", I want the values of the checkboxes returned in a string.

For example: If the user checks "computer" and "blackberry", I want to make declare a string variable "strSelection" and make it return the following string: "computer;blackberry".

Can someone help with this issue.
 
Try this:

Code:
dim strSelction as string
strSelction = ""
 
If me!Computer = true then
   strSelection = strSelection & "Computer;"
End if
 
If me!Laptop= true then
   strSelection = strSelection & "Laptop;"
End if
 
If me!Blackberry= true then
   strSelection = strSelection & "Blackberry;"
End if
 
'Trim off the trailing ";"
 
If len(strSelection)>1 then
   strSelection = left(strSelection,len(strSelection)-1)
Else
   msgbox "No products selected"
End if
 

Users who are viewing this thread

Back
Top Bottom