DropList Help?

Reply

Join Date: Sep 2007
Posts: 9
Reputation: louislam123 is an unknown quantity at this point 
Solved Threads: 0
louislam123 louislam123 is offline Offline
Newbie Poster

Re: DropList Help?

 
0
  #11
Oct 7th, 2007
ok thanks. I get it now. But now I came up with another question. How do i make it subtract and divide the datavalues selected on the droplists, then display them in a label? Is it also possible to make the answers Round up? (not down)
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 540
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

Re: DropList Help?

 
0
  #12
Oct 7th, 2007
well to perform the math you have to convert the droplist values into numbers.because they(droplist values) always come in string format.use the VAL function to do the conversion like :-

dim a,b as integer
a=val(trim(combo1.text))
b=val(trim(combo2.text))


after this you can perform any mathematical operations like :-

dim subs as integer,divd as double
subs=a-b
divd=round(a/b)


use the ROUND() to round up any values.
then u can display the output like :-

label1.caption="Substraction :" & subs
label2.caption="Division :" & divd

hope it'll help.
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 1233 | Replies: 11
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC