This was working until I added the msgbox statement. Now the !Lowest is not working. If I step through the code, it appears to be updating properly. However, when I look at the form, it still has the old value.
Dim rst As DAO.Recordset
Dim Low, High As Currency
Dim A, B, msg As String
A = "Select St_Sym, Current_Qua,Lowest,Highest "
B = "From Stock_Data Where ST_Sym = '" & fld & ""
A = A & B
Set rst = CurrentDb.OpenRecordset(A & "'")
With rst
If strPart < rst![Lowest] Then
Low = strPart
msg = "New Low 0f " & strPart & " for " & fld & ""
msg = MsgBox(msg, vbOKCancel)
If msg = vbCancel Then
Exit Function
End If
.Edit
!Lowest = Low
.Update
End If
End With
The msgbox statement is designed to stop the update if the user clicks on cancel.Thanks, Bill
Dim rst As DAO.Recordset
Dim Low, High As Currency
Dim A, B, msg As String
A = "Select St_Sym, Current_Qua,Lowest,Highest "
B = "From Stock_Data Where ST_Sym = '" & fld & ""
A = A & B
Set rst = CurrentDb.OpenRecordset(A & "'")
With rst
If strPart < rst![Lowest] Then
Low = strPart
msg = "New Low 0f " & strPart & " for " & fld & ""
msg = MsgBox(msg, vbOKCancel)
If msg = vbCancel Then
Exit Function
End If
.Edit
!Lowest = Low
.Update
End If
End With
The msgbox statement is designed to stop the update if the user clicks on cancel.Thanks, Bill