Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to remove leading zeros from numbers when I do CTRL + F?

Status
Not open for further replies.

connectionscentres

Programmer
Jan 5, 2005
16
GB
Hi,

I have a simple ms access application that allows you to scan barcodes in to a form which stores them in the database. The barcodes are 6 digits in length e.g. 555666 but my handheld scanner always adds a leading zero - e.g. 0555666. You can get round this problem by changing the database design for the field where this is stored from text to number format.

However, when it comes to quickly doing a search for a code - CTRL + F- the scanner still puts the code into the search box with the leading
zero. Is there a good way of stopping this? Would this be something I could code via a macro?

(the long-term solution has to be to find the manual and scan a system code that removes the leading zero)

Any suggestions??
 
Would it be possible for you to run your searches on a query with the code formatted to include a leading zero?
ZeroID: Format([CustID],"000000")
For example.
 
connectionscentres

There is an option box to Search Fields As Formatted in Ctrl+F
 
If you are using the Search from Ctrl+F I don't believe there is anyway to change it unless you generate code in the after_update event of the control you are scanning into, though it sounds like you have the table open and are hitting the Ctrl+F and scanning. If that's the case you are in need of the manual as you previously mentioned.

I think it would be faster to find the manual for the scanner online and reprogram it.

Ascent
 
Or search on a query with the ID formatted to include a leading 0.
 
connectionscentres said:
.. but my handheld scanner always adds a leading zero ..
You can get round this problem by changing .. the field .. from text to number format ..
However, .. the scanner still puts the code into [blue] the search box with the leading zero.[/blue]

Include, I think. :)
 
:p

e scanner still puts the code into the search box with the leading
zero. Is there a good way of stopping this? Would this be something I could code via a macro

I guess we will have to wait for the correct outcome?

Ascent
 
Which is I guess,
I think it would be faster to find the manual for the scanner online and reprogram it.

Ascent
[wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top