Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I?

Status
Not open for further replies.

serino

Programmer
Feb 13, 2003
112
US
My form has a combo box called "Ports" and another combo box called "Class of ship". What I would like to do is say for example:

A user select Seattle from the PORTS FIELD and Tanker from the CLASS OF SHIP field. In an unbound Text field produce a cost for the class of ship selected.

[Seattle]+[Tanker]=14000
[Seattle]+[Freighter]=11000

If Seattle and Tanker are selected then the associated port cost would equal $14000. The cost for a class of ship could be different depending on the selection.



Clair

 
I suspect what you want to do is put a call to some sub-routine, call it say CalculateCost, in both the Change event handler for each comb-box.

Put in some error checking to see if a valid value has been selected in each comb-box.
If valid values selected, then do your calculation in your subroutine using whatever formula you have defined, and once you have an answer then assign it to txtCost.Value.

Hope this helps
Dale
 
How are ya byurow . . . . . .

dverdi is right on target! . . . . If you supply the source of the fields that supply the numeric values (I assume their a part of the RowSource for each CB), we can give you the code!

TheAceMan [wiggle]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top