A
Afrosheen via AccessMonster.com
Good morning;
I have two identical subforms set on different tab controls that are
programed the same. The only difference is one is for day shift and the other
is for night shift.
I use this routine to see if there is a duplicate StaffId. Again, I use this
on both subforms. The problem is that on the first subform it works. On the
second subform it doesn't work. The record sets are the same for both. I'm
also using a filter for the difference between day shift and night shift.
This is the code:
20 With RecordsetClone
30 .FindFirst "StaffId = '" & [StaffId] & "'"
40 If .NoMatch Then
50 Exit Sub
60 Else
70 Select Case MsgBox("Sorry, This is a duplicate Staff Id Number,"
_
& vbCrLf & "" _
& vbCrLf & "Which means they already exist.. Try
again?" _
, vbYesNo Or vbQuestion Or vbDefaultButton1,
"Warning Warning")
Case vbYes
80 Cancel = True
90 Me.Undo
100 Case vbNo
110 Cancel = True
'Me.Undo
120 If Me.Dirty Then Me.Undo
130 DoCmd.GoToRecord , , acLast
140 End Select
150 End If
160 End With
Is there something I could look for to correct this problem?
Thanks for your time and help.
I have two identical subforms set on different tab controls that are
programed the same. The only difference is one is for day shift and the other
is for night shift.
I use this routine to see if there is a duplicate StaffId. Again, I use this
on both subforms. The problem is that on the first subform it works. On the
second subform it doesn't work. The record sets are the same for both. I'm
also using a filter for the difference between day shift and night shift.
This is the code:
20 With RecordsetClone
30 .FindFirst "StaffId = '" & [StaffId] & "'"
40 If .NoMatch Then
50 Exit Sub
60 Else
70 Select Case MsgBox("Sorry, This is a duplicate Staff Id Number,"
_
& vbCrLf & "" _
& vbCrLf & "Which means they already exist.. Try
again?" _
, vbYesNo Or vbQuestion Or vbDefaultButton1,
"Warning Warning")
Case vbYes
80 Cancel = True
90 Me.Undo
100 Case vbNo
110 Cancel = True
'Me.Undo
120 If Me.Dirty Then Me.Undo
130 DoCmd.GoToRecord , , acLast
140 End Select
150 End If
160 End With
Is there something I could look for to correct this problem?
Thanks for your time and help.