It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Numeric values in a combo

Moderator: dafunkymunky

Numeric values in a combo

Postby Rude_G on Sat Sep 20, 2008 9:16 pm

How do you only use the numeric values in a combo. For example, 3.99 hamburger , how would you leave out the text for hamburger and use just the price 3.99
Rude_G
 
Posts: 2
Joined: Sat Sep 20, 2008 9:06 pm

Postby fifarunnerr on Sun Sep 21, 2008 12:08 pm

I made it, you have to do something like:

Code: Select all
Private sub form_load()
Combo1.additem "3.99 hamburger"
End sub


and:

Code: Select all
Private Sub Command1_click()
text1.text = Val(Combo1.text)
end sub


If you click on Commandbutton 1, and you selected the hamburger, you will see in text1: 3.99

You must remember:
- You must put the value with a dot, so it must be: 3.99 and not 3,99
fifarunnerr
 
Posts: 7
Joined: Sun Sep 21, 2008 10:20 am

Postby Rude_G on Sun Sep 21, 2008 6:43 pm

thanks man
Rude_G
 
Posts: 2
Joined: Sat Sep 20, 2008 9:06 pm


Who is online

Users browsing this forum: No registered users and 7 guests