How to tackle duplicate records issue

gear

Registered User.
Local time
Today, 00:15
Joined
Mar 10, 2007
Messages
112
In my database I have a a date field and Number field with sequential numbering with DMax which will reset to 1 when the year changes. I reset the PC clock to 2008 and checked by entering two records and it works fine. Now my problem is how do I tackle the problem of duplicate records. The DB displays No.1 record from 2007 and another No.1 record from 2008. Is there a way to ask the user to input the year and then the DB takes up only the desired year's records for data entry, search, print etc. Shall be grateful for help.
 
In my database I have a a date field and Number field with sequential numbering with DMax which will reset to 1 when the year changes. I reset the PC clock to 2008 and checked by entering two records and it works fine. Now my problem is how do I tackle the problem of duplicate records. The DB displays No.1 record from 2007 and another No.1 record from 2008. Is there a way to ask the user to input the year and then the DB takes up only the desired year's records for data entry, search, print etc. Shall be grateful for help.

Add a year field and set the default to be =year(now()) ??
 
Since my DB is to be maintained on yearly basis, I want the prg to ask the user the input year. If the year is less than the current year, it should pop up the message that "No addition/deletion allowed". I tried this code but it is not working :
If Year(Date) = <Year([Date]) Then
If MsgBox("No Addition/Deletion Allowed", vbQuestion) Then
Cancel = True
Me.Undo
DoCmd.Close acForm, acSaveNo
Else
End If
End If

Grateful for help.
 
Where are you getting the [Date] from? Is it an input box, or a text box on the form?
 
I have a Date field set to =Date() Sir.
 
Sorry I didnt understand properly. I have a query that filters records yearwise. I used the criteria Like "*" & [Enter the year: ] & "*"
 

Users who are viewing this thread

Back
Top Bottom