L'apprentis
Redcifer
- Local time
- Today, 05:26
- Joined
- Jun 22, 2005
- Messages
- 177
Hello,
I am writting my first function and I am facing a mismatch error, I don't know why.
The function is quite long but I have reduced it to the following code and I am still getting the mismatch error? Is there any error in the following code? I have also check the format of tablconst where NortonFactor is set as a double,
I am writting my first function and I am facing a mismatch error, I don't know why.
The function is quite long but I have reduced it to the following code and I am still getting the mismatch error? Is there any error in the following code? I have also check the format of tablconst where NortonFactor is set as a double,
Code:
Public Function FctCastPrice(Weight As Double) As Currency
'Code to get the Price of casting just by knowing its weight and material [low carbon (LC) or stainless Steel (SS)]
'list of variable that are going to be equal to the constant define in tableConst
Dim rs As ADODB.Recordset
Dim dNortonFactor As Double
' Set variable with value from tableconst
Set rs = CurrentDb.OpenRecordset("tblConst")
dNortonFactor = rs!NortonFactor
Set rs = Nothing
If Forms!frmFctBuilding.TxtMaterial = "Low Carbon" Then
FctCastPrice = dNortonFactor * Weight
End If
End Function
Last edited: