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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with setting Input Mask/ Format on Field

Status
Not open for further replies.

smoker1

Programmer
Jun 18, 2001
76
US
Hello all! I haven't been working with Access 2000 much lately, and have forgotten some of my old "tricks".

I am designing a contact management DB which needs to have the an automatic contact id. I want the id to have the following format:

current year - integer
(ex: 2002-1)

I can't figure out how to get the input mask to accept this format.

Can anyone assist? Thanks in advance.

Angela

 
Actually, I want the year to be constant. So the first record would be contact 2002-1. The second, 2002-2. The hundredth, 2002-100.....

Any help?
 
Using this input mask on a field called JobNo in a table called tblRequest, I have this bit of code on the OnCurrent event of the form I use for data entry.

Code:
If Me.NewRecord = True Then
    If IsNull(DMax("JobNo", "tblRequest", "Year=" & Year())) Then
        JobNo = 100 + Right(Year(), 2)
    Else
        JobNo = 100 + DMax("JobNo", "tblRequest", "Year=" & Year())
    End If
End If
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top