Our ID cards have a magnetic strip that automatically inserts % before the ID number and ? after the number like this: %255? (this is passID number 255). When the ID card is scanned into the unbound control, IDSearch, I want the control to ignore the % and ? and just read the number. Is there a way to do this?
I've tried this code on the before update event of cboIDSearch:
But when I type in a number or the symbols and number I get the following error:
The function set to the Before Update property for this field is preventing Microsoft Access from saving the data in the field.
I also tried this:
And I got this error:
Invalid use of null
FYI: There's a code in the AfterUpdate event of cboIDSearch that stores the PassID and a timestamp. Otherwise, this scan is used to bring up this record at the bottom of the form.
Can you spot what I'm doing wrong?
Thanks,
Dori
I've tried this code on the before update event of cboIDSearch:
Code:
Me.[cboIDSearch] = Mid(Left(Me.[cboIDSearch], Len(Me.[cboIDSearch]) - 1), 2)
The function set to the Before Update property for this field is preventing Microsoft Access from saving the data in the field.
I also tried this:
Code:
Me.cboIDSearch = Replace(Replace(Me.PassID, "%", ""), "?", "")
Invalid use of null
FYI: There's a code in the AfterUpdate event of cboIDSearch that stores the PassID and a timestamp. Otherwise, this scan is used to bring up this record at the bottom of the form.
Can you spot what I'm doing wrong?
Thanks,
Dori