How do code this?

hmho

Registered User.
Local time
Yesterday, 16:48
Joined
Apr 7, 2009
Messages
93
I have form that we will enter data (Numbers) by barcode reader and we have to different kinds barcodes. What I would like to do is formula that says if the first three digits is less than or equal 899 delete the last five digits else delete the last seven digits. Is this possible. here are two examples of the barcodes and what I need the outcome to be.

1. 89912345678 = 899123

2. 90012345678 = 9001

Any advice will be appreciated.
 
Last edited:
Try

If CInt(Left(FieldName, 4)) < 900 Then
 
Pblady,

This code in the form or in query. How do I post the formula?

Thanks
 
When used in a query:

BarCode:Iff(CInt(Left(FldBarcode,3)) < 900,Left(FldBarcode,Len(FldBarcode)-5),Left(FldBarcode,Len(FldBarcode)-7))


David
 

Users who are viewing this thread

Back
Top Bottom