Code: Select all
Private Sub prod_line_shift_Exit(Cancel As Integer)
Dim dub As Integer
dub = 0
' checks to see if the information has been entered already.
' If the production sheet has already been entered once you cannot enter it again.
If (Me.c_prod_line <> " ") And (Me.prod_line_date <> " ") And (Me.prod_line_shift <> " ") Then
dub = DCount("[prod_line]", "1_tb_prod_line_input", "[prod_line] = '" & Me.c_prod_line.Value & "' And [prod_line_date] = '" & Me.prod_line_date.Value & "' And [prod_line_shift] = " & Me.prod_line_shift.Value)
Else
Me.c_prod_line.SetFocus
MsgBox "The Line, Date and, Shift must filled in please.", vbInformation, "Missing Data"
End If
If (dub <> 0) Then
MsgBox "There has been an duplicating error, please check the data.", vbInformation, "Error"
Me.prod_line_date.SetFocus
End If
End Sub
Code: Select all
dub = DCount("[prod_line]", "1_tb_prod_line_input", "[prod_line] = '" & Me.c_prod_line.Value & "' And [prod_line_date] = #" & Me.prod_line_date & "# And [prod_line_shift] = " & Me.prod_line_shift)
Also tried
dub = DCount("[prod_line]", "1_tb_prod_line_input", "[prod_line] = '" & Me.c_prod_line & "' And [prod_line_date] = #" & Me.prod_line_date & "# And [prod_line_shift] = " & Me.prod_line_shift)