I found another issue:
The following Code:
Option Compare Database
Private Sub Form_Load()
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.GoToRecord acDataForm, "CTParkingLLC", acNewRec
Forms!CTParkingLLC!FindTAG.SetFocus
End Sub
Private Sub FindTAG_AfterUpdate()
If (FindTAG & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[TAG]=" & FindTAG
If rs.NoMatch Then
DoCmd.GoToRecord acActiveDataObject, , acNewRec
Me!TAG = Me.FindTAG
Me.TimeIn = Now()
Me.HoulyRate = 7
Else
Me.Recordset.Bookmark = rs.Bookmark
Me.TimeOut = Now()
Me.ElapsedTime = DateDiff("n", [TimeIn], [TimeOut])
End If
X = [ElapsedTime] / 60 * [HoulyRate]
If X < 2 Then
Me.AmountOwed = 2
Else
Me.AmountOwed = X
End If
rs.Close
FindTAG = Null
End Sub
What happens is that if my mistake the software user scan a record that has a TimeOut already I need to provide a pop up box to say, "Invalid Record"
The problem is that if there is a record there that already has a TimeIn and a TimeOut with an HourlyRate already calculated and by mistake the software user scans the old record barcode again it updates the TimeOut again adn calculate the rate again to a higher value.
What I need it to do is the following:
Before the following code it needs to check the TimeOut and only execute the following code if the TimeOut is Null but if there is value in the TimeOut it needs to give a pop up as invalid record.
Me.Recordset.Bookmark = rs.Bookmark
Me.TimeOut = Now()
Me.ElapsedTime = DateDiff("n", [TimeIn], [TimeOut])
Thanks for everything...