|
-
May 3rd, 2000, 08:52 AM
#1
Thread Starter
New Member
I have no idea how to use a combo box, I can enter the options, just dont know how to give them individual commands.
Can anybody help?
-
May 3rd, 2000, 09:18 AM
#2
Addicted Member
A little clarification...
What exactly do you mean by "...I can enter the options, just dont know how to give them individual commands."
Do you want to know how to put the info into the ComboBox or are you looking at triggering a certain event after a particular value is selected?
-
May 3rd, 2000, 09:49 AM
#3
if you want to add items to the combobox, then all you have to do is put this into your form_load event.
combo1.additem "Whatever"
and keep doing that untill you have everything that you want. then you have to put some code in the combo1_change event so when you select one of those items, your code will execute. i hope i was of some help.
-
May 3rd, 2000, 10:40 AM
#4
Correction. You have to use Combobox_Click event to trap when you select items from the list. Change event fires when you type in the textbox of the combobox.
-
May 3rd, 2000, 11:29 AM
#5
oh yeah, heh i rarely use cboxes so i forget. thanks for correction, i guess.
-
May 4th, 2000, 04:40 AM
#6
Thread Starter
New Member
I'm not sure how to explain what I'm looking for.
Okay, I have created the combobox, inside the combobox I have the options (for the user to select) entered. I used the List option in the preference window to enter the user options.
What I'd like to know is how do I tell the program what I'd like to do with each individual option within the combobox.
Like if my box has "Option1" as one of the choices, I want to know how to tell the program what to do when that is selected.
Thanks a lot!!
-
May 4th, 2000, 05:04 AM
#7
This should help
Code:
If Combo1.Text = "Option 1" Then MsgBox ("you selected Option 1")
-
May 4th, 2000, 08:31 AM
#8
Thread Starter
New Member
Thanks
Thanks a lot!!! Really appreciate it, works fine.
-
May 4th, 2000, 09:28 AM
#9
Addicted Member
You could also use a SELECT CASE statement to do the same thing.
Code:
strTemp = Combo1.Text
Select Case strTemp
Case "Option 1"
'Put your code for option 1 here
Case "Option 2"
'Put your code for option 2 here
Case "Option 3"
'Put your code for option 3 here
Case "Option 4"
'Put your code for option 4 here
Case Else
'Put code for any other selection here.
End Select
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|