Solved

access PK field

Posted on 2014-01-17
3
445 Views
Last Modified: 2014-01-17
I have a excel file that formats a number like 111, 5555 like this > 00111, 05555 – so that its 5 digits always. Now the excel file has the metric column like that. How do I make or set the first field in a table in access so that it takes numbers with leading zeros (total digits – 5) and stores it just like that?
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 260 total points
ID: 39790131
Choose Text for field type.
0
 
LVL 30

Assisted Solution

by:hnasr
hnasr earned 240 total points
ID: 39790156
Have, as GrahamSkan commented, a text field type. and use:
fld = Right("00000" & fld, 5)

Open in new window

0
 

Author Comment

by:Rayne
ID: 39790167
Awesome you both :)
Thank you
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question