Hi
Been struggling with this for several hours - anything obviously wrong with the code below. I've used a DLookup to find valueSignInFastTrackID5, it returns 4851. However the code appears to find a match but the MsgBox "true" line doesn't kick in and the record isn't altered. I can't see where I'm going wrong:banghead:
Been struggling with this for several hours - anything obviously wrong with the code below. I've used a DLookup to find valueSignInFastTrackID5, it returns 4851. However the code appears to find a match but the MsgBox "true" line doesn't kick in and the record isn't altered. I can't see where I'm going wrong:banghead:
Code:
Dim dbFast2 As DAO.Database
Dim rstFast2 As DAO.Recordset
Dim valueSignInFastTrackID5 As Integer
MsgBox valueSignInFastTrackID5 'returns 4851
If IsNumeric(valueSignInFastTrackID5) Then
MsgBox "numeric" ' it says it's numeric
End If
Set dbFast2 = CurrentDb
Set rstFast2 = CurrentDb.OpenRecordset("visitorSignOUTDetailsQuery", , dbOpenDynaset)
rstFast2.FindFirst [VisitorSignInID] = valueSignInFastTrackID5
If rstFast2.NoMatch Then
MsgBox "no match"
Else
MsgBox "match" ' says it's found a match
End If
If rstFast2![VisitorSignInID] = valueSignInFastTrackID5 Then
MsgBox "true" ' this msg box doesn't appear
rstFast2.Edit
rstFast2![SigOut] = "FastTrack"
rstFast2![DateOut] = Now
rstFast2![TimeOut] = Now
rstFast2.Update
rstFast2.Close
Set rstFast2 = Nothing
Set dbFast2 = Nothing
End If