The result looks good. the only issue now is that it adds an empty record to my continuous form. Any idea why it would do that?
Here is the code.
Code:
Private Sub cboPoCurrency_AfterUpdate()
On Error GoTo ErrHandler
Dim db As Database
Dim strSql As String
Dim dblRate As Double
Set db = CurrentDb
dblNCostR = DLookup("ExRate", "Currency", "ID = " & [cboCurrency])
dblRate = dblNCostR / dblOCostR
With Me.sbfProductDetails.Form
.txtUnitCost = .txtUnitCost * dblRate
End With
DoCmd.SetWarnings False
strSql = "UPDATE QuoteLineItems SET QuoteLineItems.UnitCost = [UnitCost] * " & dblRate & _
" WHERE QuoteLineItems.QuoteID = " & Me.txtID & ";"
DoCmd.RunSQL strSql
Me.txtExRate.Value = dblNCostR
Set db = Nothing
ExitSub:
Exit Sub
ErrHandler:
Call ErrorAlert
Resume ExitSub
End Sub