Input mask ?????

A

asrul

Hi All,
Have a good day.

I want to create a PK with text.I want the data formatted
like : ABC_9999.

ABC represent three digits of the month.
while _ is separator.
9999 initialize increment number start with 1.

Data example : JAN_0001
JAN_0002 and so on.

Do I should use input mask? How to format it?

Thank's for the clue.
Regards,
 
J

John W. Vinson

Hi All,
Have a good day.

I want to create a PK with text.I want the data formatted
like : ABC_9999.

ABC represent three digits of the month.
while _ is separator.
9999 initialize increment number start with 1.

Data example : JAN_0001
JAN_0002 and so on.

Do I should use input mask? How to format it?

Thank's for the clue.
Regards,

This is A VERY BAD IDEA.

Storing two pieces of information in one field is incorrect design: fields
should be atomic.

Storing ambiguous data in primary keys is incorrect design: is JAN_0001
January 2009? or 2010? or 1995? Will you discard your database on December 31
to allow for a new set of fields?

You're aware that a table sorted in primary key order will show April data
first, then August, then December... in alphabetical order by primary key?

Date data *IS DATA*. Store a created-date field in the table, using a
date/time field with =Date() as the default value; use =Now() if you want the
date and time. It's very easy to create a query retrieving all the data for
January, or for the first quarter, or whatever: having that information stored
in your primary key value will make that *harder*, not easier.

I'd really urge you to reconsider. If you insist, post back with a rationale.
It can e done; I'd just say that you will regret doing it later.
 
A

asrul

Thank's for the quick reply John,
noted it.

Now I consider to re-design my table.
But,may be I'll be back when am stuck.

Regards,
 
J

John W. Vinson

Thank's for the quick reply John,
noted it.

Now I consider to re-design my table.
But,may be I'll be back when am stuck.

You might want to take a look at some of these resources and samples:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

A free tutorial written by Crystal (MS Access MVP):
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top