How to set value to the combo box using select case or if statement in

this value will used for the formula calculation in the form

Page 1 of 1

2 Replies - 7622 Views - Last Post: 01 September 2010 - 11:15 PM Rate Topic: -----

#1 satheesh985  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-September 10

How to set value to the combo box using select case or if statement in

Posted 01 September 2010 - 03:34 AM

in combo box string is xxx and yyy and zzz.we have to store the value to each string like xxx=10, yyy=20 and zzz=30. formula is string(xxx)/1.71^(1/2).. if we select xxx formula have to take value 10 or yyy means formula have to take value 20.
Is This A Good Question/Topic? 0
  • +

Replies To: How to set value to the combo box using select case or if statement in

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: How to set value to the combo box using select case or if statement in

Posted 01 September 2010 - 05:30 AM

Using a Select Case statement, you could base the Case off of the Combobox.SelectedItem

That should allow you to then set a value off of the item selected.

If you get stuck, post your code attempt so that someone can give you more in-depth help. We will help you with your problem but we won't write the code for you. :)

This post has been edited by CharlieMay: 01 September 2010 - 05:31 AM

Was This Post Helpful? 0
  • +
  • -

#3 emresutisna  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 80
  • Joined: 14-May 09

Re: How to set value to the combo box using select case or if statement in

Posted 01 September 2010 - 11:15 PM

Perhaps this is what you mean :
dim cboVal, result as Integer
Select Case ComboBox1.Text
  Case "xxx"
     cboVal = 10 
  Case "yyy"
     cboVal = 20
  Case Else
     cboVal = 30
End Select
result = cboVal/1.71^(1/2)
MessageBox.Show(result.ToString)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1