txgeekgirl
Registered User.
- Local time
- Today, 11:46
- Joined
- Jul 31, 2008
- Messages
- 187
The longer I am alive - the more assured I am that my job is not as developer but as stupidity catcher. I think in the past 6 months I have written more code to stop the actual ability of one to be stupid as an end user than working on my fun projects.
Here we go:
I have a simple quick and dirty DB in Access / VBA which allows scanners to track what they've said they've scanned. You choose a program, input a case number and how many pages you've scanned by section and the date.
Problem - they are trying to use alpha characters in the the case number in more than the three situations where characters are allowed. Here is what I have so far:
I have no idea how it's suppose to work - other than read the ascii val of a num/letter and say what's allowable.
Here we go:
I have a simple quick and dirty DB in Access / VBA which allows scanners to track what they've said they've scanned. You choose a program, input a case number and how many pages you've scanned by section and the date.
Problem - they are trying to use alpha characters in the the case number in more than the three situations where characters are allowed. Here is what I have so far:
Code:
Sub CheckCasenum()
If Me.Type <> "MHCNMID" Or Me.Type <> "MHCNOD" Or Me.Type <>"MHCNFR" Then
IsClean (Me.CaseNotxt)
MsgBox Me.CaseNotxt
End If
End Sub
Code:
Public Function IsClean(strToCheck) As Boolean
Dim lng As Long
Dim CleanMe As Boolean
If Len(strToCheck) > 0 Then
For lng = 1 To Len(strToCheck)
Select Case Asc(Mid$(strToCheck, lng, 1))
' Numbers 0 to 9
Case 48 To 57
' Letters A to Z
Case 65 To 90
' Letters a to z
Case 97 To 122
Case Else
Clean = True
Exit For
End Select
Next lng
End If
IsClean = Not CleanMe
MsgBox CStr(CleanMe)
End Function
I have no idea how it's suppose to work - other than read the ascii val of a num/letter and say what's allowable.