Tech Support Guy banner
Status
Not open for further replies.
1 - 19 of 19 Posts

· Registered
Joined
·
23 Posts
Discussion Starter · #1 ·
I have a field in my Access 2003 database that currently requires the user to enter the 2 digit month & 2 digit year of the incident as the prefix (prefix) to the case number. I would like to have this automatically created based on the date entered in the date of incident field (date).

Any ideas would be appreciated.
 

· Registered
Joined
·
19,932 Posts
In the AfterUpdate event procedure of the date of incident field you need some VBA code. What exact format do you want the case number?
 

· Registered
Joined
·
23 Posts
Discussion Starter · #9 ·
The full case number with the prefix would be 0312-0001. The prefix is stored in a seperate field in the table and used as reference for relation to the previous filing system and to prevent confusion with outside agencies. They do not have to be combined in the database.
 

· Registered
Joined
·
19,932 Posts
me.Prefix = month(me.datefieldname) & Year(me.datefieldname)
the datefieldname should not really be date as that is the name for the System date and might cause some confusion for Access and VBA.
 

· Registered
Joined
·
23 Posts
Discussion Starter · #15 ·
Private Sub Date_Received_Exit(Cancel As Integer)
Me.Prefix = Month(Me.Date_Received) & Format(Me.Date_Received, "yy")
End Sub


Returns error "Can't find project or library"
 

· Registered
Joined
·
19,932 Posts
Odd that you didn't get that error witht he previous code.
Open the database, press Alt + f11 to open the VBA Editor.
On it's main menu>Tools>References
Are there any References with "Missing" against them?
 

· Registered
Joined
·
23 Posts
Discussion Starter · #17 ·
Got a message regarding missing ACEDAO.DLL version 12.0 when I selected the references option.

References shows MISSING MICROSOFT OFFICE 14.0 ACCESS DATABASE ENGINE OBJECT LIBRARY

I don't have OFFICE 14.0 (2010) or 12.0 (2007).

I have OFFICE 11.0 (2003)

How do I fix that one? (he says with great frust
 

· Registered
Joined
·
23 Posts
Discussion Starter · #19 ·
That fixed it. Thanks

Both of the following return the desired result:

Me.Prefix = Month(Me.Date_Received) & Format(Me.Date_Received, 'yy')
or
Me.Prefix = Format(Me.Date_Received, "mmyy")
 
1 - 19 of 19 Posts
Status
Not open for further replies.
Top