Somebody kindly helped me with a DLookup Function, it works but sometimes a code (string) will get entered and a space will appear in it, which stops the DLookup from working.
eg SL6K6 may get entered as SL 6K6. The code is scanned in so i can't uses a filter.
Is there any way around this?
Private Sub TxtBoxQty_BeforeUpdate(Cancel As Integer)
If DCount("[Spec]", "Stolen", "[BoxNo] = '" & Me.BoxNo & "' And [SpecCode] = '" & Me.SpecCode & "'") = 1 Then
MsgBox "This box is registered stolen", "vbcritical", "STOLEN BOX"
Cancel = True
Me.Undo
Exit Sub
Else
'Do nothing
End If
End Sub
Thanks.
eg SL6K6 may get entered as SL 6K6. The code is scanned in so i can't uses a filter.
Is there any way around this?
Private Sub TxtBoxQty_BeforeUpdate(Cancel As Integer)
If DCount("[Spec]", "Stolen", "[BoxNo] = '" & Me.BoxNo & "' And [SpecCode] = '" & Me.SpecCode & "'") = 1 Then
MsgBox "This box is registered stolen", "vbcritical", "STOLEN BOX"
Cancel = True
Me.Undo
Exit Sub
Else
'Do nothing
End If
End Sub
Thanks.