Year Field

M

Mary

I am new to Access.

I want to add a field for entering Year.
1) Should I choose Text or Number ?
2) For input mask, can I use 0000
3) How can I check the range of year ?

Thanks
 
J

Joseph Meehan

Mary said:
I am new to Access.

I want to add a field for entering Year.
1) Should I choose Text or Number ?
2) For input mask, can I use 0000
3) How can I check the range of year ?

Thanks

It depends on what you want to do with the results. If you are going to
only use years and will not go negative and you want to do some calculation
on them (check range?) then you will need to use a number or date type.

If you think you may want to add months or days later, I suggest making
it a date type.
 
M

Mary

Yes, we only need the Year and it will not be negative.

Would you mind to give me some advice on the input mask
and how to check the range ?

Thanks
 
M

Mary

When I apply the input mask in the table, it doesn't work
properly. Should I apply the input mask in the form ?
Instead of giving error message "value entered invalid for
input mask 0000", can I change this message to become more
meaningful ?

Besides, how can I limit the year entered ? For instance,
between 1980 and 2099 ?

Thanks
 
L

Larry Linson

Use a validation rule for the Field or for the Control, or put VBA code in
the Before Update event, with which you can be a little more
"user-friendly".

Larry Linson
Microsoft Access MVP
 
J

Joseph Meehan

Mary said:
When I apply the input mask in the table, it doesn't work
properly. Should I apply the input mask in the form ?

A mask does not go with the data. That is it only changes the way the
data is displayed in the specific form report etc to which it is applied.
So yes you need to apply it where you want the data to appear as four
characters.
 
A

Arvin Meyer

A mask does not go with the data. That is it only changes the way the
data is displayed in the specific form report etc to which it is applied.
So yes you need to apply it where you want the data to appear as four
characters.

You are, perhaps, confusing the Format property with an Input Mask.
Formatting changes the way data is displayed without changing the data
itself. An InputMask changes the way data is entered.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
J

Joseph Meehan

Arvin said:
You are, perhaps, confusing the Format property with an Input Mask.
Formatting changes the way data is displayed without changing the data
itself. An InputMask changes the way data is entered.

I should have said it changes the way the data is displayed and
restricts the data entered. You are right. Both apply only (I believe) to
the form, table etc that they are applied to.
 

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