Find the error in my VB6 code that prevents the proper value
$30-250 USD
Completed
Posted almost 15 years ago
$30-250 USD
Paid on delivery
I have this function in VISUAL BASIC 6 that updates a record. I can't get it to update 1 certain field, "SPR". It works fine when, a) after I close my application and re-open it, or b) when I substitute a hard value for the variable (aka, instead of SPRTemp, I use .5). Can anyone please take a look at this function and see what might be going wrong?
I'll also upload the complete module. If there's other info you need, I'll answer any questions you may have. I'm also open to giving you remote access to my computer so you can debug along side of me (RECOMMENDED!!!!)
Dim SPRTemp As Single ' for temporary storage of SPRDiscount
[login to view URL] = False
If txtSPRDiscount <> "" Then SPRTemp = rPlace(txtSPRDiscount)
If Not IsNull(SPRTemp) Then
If IsNumeric(SPRTemp) Then
If SPRTemp > 0 And SPRTemp < 100 Then
SPRChange = True
SPR2 = Val(Replace(txtSPRDiscount, "%", "")) / 100
If Not performComputeData Then ' Compute Data based from the SPR input
[login to view URL] "Error Computing Data"
Else ' if there's no error lstProgram will be enabled and function performComputeData will be initiated
SPRTemp = SPRTemp / 100
performComputeData
'---- Update out_03_DealConfigs based from SPR changes ----
performMoveData
editSPRTruckNotes txtNumber, ModelID, currConfigID, _
"SPR=" & SPRTemp & _
", DealerNet=" & FinalDealerNet & _
", FinalCost=" & FinalCost & _
", FinalCurrentCost=" & FinalCurrentCost & _
", FinalGoingToCost=" & FinalGoingToCost & _
", Margin=" & FinalMargin & _
", CurrentMargin=" & FinalCurrentMargin & _
", GoingToMargin=" & FinalGoingToMargin & _
", MarginPercent=" & AdjustMarginPercent & _
", CurrentMarginPercent=" & AdjustCurrentMarginPercent & _
", GoingToMarginPercent=" & AdjustGoingToMarginPercent
SPR2 = SPRTemp
[login to view URL] = True
End If
Else
txtSPR = 0
End If
End If
End If
MsgBox Val(SPRTemp)
End Sub
Function editSPRTruckNotes(ByVal DealNumber As String, ByVal ModelID As Long, _
ByVal ConfigId As Long, ByVal editString As String)
'---- Function that will edit SPR in out_03_DealConfigs -----
Dim rs As Recordset
Dim dbObj As New dbFunctions
Dim i As Integer
[login to view URL] = strConn
mSQL = "SELECT * FROM out_03_DealConfigs WHERE DealNo = '" & DealNumber & "' AND " & _
" ModelID = " & ModelID & " AND ConfigurationID = " & ConfigId
Set rs = [login to view URL](mSQL, isException, errDesc)
If isException = 0 Then
If Not [login to view URL] Then
If Not [login to view URL]("out_03_DealConfigs", editString, "DealNo = '" & DealNumber & "' AND " & _
" ModelID = " & ModelID & " AND ConfigurationID = " & ConfigId, errDesc) Then
[login to view URL] "Error Editing SPR"
End If
End If
End If
Set rs = Nothing
Set dbObj = Nothing
End Function
I have done MCA and i have exp of VB project 1 yr
i will try to solve ur problem but for this i have to debug ur project so pls if u can provide ur project then it will be easy for me
Hi
Why unnecessarily you are bidding for bug fix? You need not to pay me anything. I am from India.
I am C/C++ programmer. Lets work on together to fix this issue.
If you are interested let me know so that we can work.
Thanks and Regards
Sathish Kumar