hardhitter06
Registered User.
- Local time
- Today, 06:14
- Joined
- Dec 21, 2006
- Messages
- 600
Hi,
I have this code:
which checks to see if an AssetNumber already exists in the system or if you have entered the correct length of an AssetNumber (10 characters/digits)
I know this is overkill but is there a way to insure the last character/digit of the asset number is a ZERO and not the letter "O"? lol - because of the people i work with...
Thank you
I have this code:
Code:
Private Sub AssetNumber_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
strIdNumber = Me.AssetNumber
Answer = DLookup("[AssetNumber]", "tblMain", "[AssetNumber] = '" & Me.AssetNumber & "'")
If Not IsNull(Answer) Then
MsgBox "Duplicate Asset Number Found." & vbCrLf & "Please enter again.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
Cancel = True
Me.AssetNumber.Undo
End If
If Len(AssetNumber) <> 10 Then
MsgBox "Asset must be 10 characters, re-enter.", vbOKOnly, "Error"
Cancel = True
Me.AssetNumber.Undo
End If
End Sub
which checks to see if an AssetNumber already exists in the system or if you have entered the correct length of an AssetNumber (10 characters/digits)
I know this is overkill but is there a way to insure the last character/digit of the asset number is a ZERO and not the letter "O"? lol - because of the people i work with...
Thank you
Last edited: