How do I step through the code of just that module...the only thing I see is a Compile Cooling Cost (the name of my db) in the DeBug list.
I watered down my code...you'll get the idea...
T1 is actually named txtheatgain and is entered by the user Format: general number
T2 is txtcoolingcap and is received from an AfterUpdate Event in a combo box. It is a column in the combo box that is assigned to txtcoolingcap once a selection is made. Format: general number
T3 is txtcostfactor and has control source
=CostFactor([txtcoolingcap],[txtheatgain])
The function CostFactor is declared in the CostFactor module with this code...
Function CostFactor(lngCoolingCapacity As Long, lngHeatGain As Long) As Double
Dim intcooling As Integer
Dim inthtgn As Integer
Dim CstFact(2,2) As Double
/*Then I populate the Array Like This*/
CstFact(0,0) = 1.00
CstFact(0,1) = 1.14
CstFact(0,2) = 1.29
/*I've never done an array in VB before...only in C...would love to know if there's a better way to fill a multidimensional array without assigning each one individually*/
/*This next part is watered down...I hard-coded figures for examples' sake...*/
Select Case lngCoolingCapacity
Case lngCoolingCapacity = 18000
intcooling = 0
Case Else
intcooling = 1
End Select
Select Case lngHeatGain
Case lngHeatGain = 22400
inthtgn = 2
Case Else
inthtgn = 0
End Select
CostFactor = CstFact(intcooling,inthtgn)
End Function
If you can muddle through that and give any advice I would love any and all input. I'm a C programmer by nature and VB is pretty close.
I'm trying.
Help.
Rebecca