Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

VB combos/formula


  • Please log in to reply

#1
scozzard

scozzard

    Member

  • Member
  • PipPip
  • 26 posts
hello there

Im making an kind of "calculator" application in VB (6.0) which has two two inputs and 4 outputs - each with corrosponding comboboxes illustrating the kind of data in each (eg, kj/kg, m3/kg etc) creating different outputs through different formula. You enter numerical values into the input text feilds and depending what index is selected in the corrosponding comboboxes, different formula are used in producing the outputs in the output fields (labels). And its the same with the outputs, they have corresponding comboboxes illustrating the kind of data. I guess basically what im saying is, how do i incorporate comboboxes into altering the formula used in the inputs and then displaying different data in the output?

Iv got the feeling that the dribble iv just written could be hard to make sense of but if anyone knows what im talking about then any help would be appreciated. I got the VB manuals etc so just maybe a jist of what to look up etc. The formulae come from a psychrometric chart just incase anyones familiar thermodynamic properties... :S

:tazz:
  • 0

Advertisements


#2
ricci

ricci

    Member

  • Member
  • PipPip
  • 64 posts
Hi scozzard,

I'm not very familiar with VB 6, but there should be a property on your comboboxes to determine the index of the selected item, or the selected item itself. You can then use a select...case statement to execute code based on which item in the combobox was selected.

Hope that helps,
Ricci
  • 0

#3
MaverickSidewinder

MaverickSidewinder

    Member

  • Member
  • PipPipPip
  • 257 posts
I didn't get what you were trying to say...but if this helps:

To add an item to a combobox you have to do this in the Form_Load() Private Sub...

Then..on the combobox...you have to put IF statements:

If Combobox1.Index = 1 Then
FUNCTION
End If
If Combobox1.Index = 2 Then
FUNCTION
End If

(i haven't used comboboxes in a while)...

Anyway, every item on the list has an index VALUE (0,1,2,3 ---> and so on)
  • 0

#4
scozzard

scozzard

    Member

  • Topic Starter
  • Member
  • PipPip
  • 26 posts
Hey thanks for the help

Yea i did the linking of the combo boxes which works fine but proves extremely extensive when corrolating 6 combos as inputs and outputs!
Anyways, iv found that the formula are just too complex to do in VB and it would be easier to link the program to an excel spreadsheet? does anyone know about how to go about doing this??
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP