Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 8th, 2007, 11:29 PM
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sequential numbering help

My Access database has Data field, Year field, Number field. The number field is set with DMax function which will reset the number to 1 when the year changes. I was help on the following :
1. The DB should take only the current year's records for active use i.e. data entry, edit, search, print etc.
2. The DB should allow previous year's records for search and print only and NOT allow data entry and edit.
How can I do it. Please help

Reply With Quote
  #2 (permalink)  
Old April 9th, 2007, 06:31 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Before you do either of these functions, take the year in a variable and pass it to the function.

dtCurYear = DatePart("yyyy", Date())

For example when you open the data entry form, set the filter to the current year, or if it is based on a query, pass the year to the query(WHERE [dtYear] = " & dtCurYear

Allow users to open the form for previous years, but on that button, pass WHERE [dtYear] <> " & dtCurYear.

You may have to add date ## signs before and after. And of course you will want to date stamp every record with the current year. It is easier if you store the year by itself in a seperate field as I have done, but you can also just add a date created field, pass the current date to it, and check the year datepart of that field.

Did this help?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access sequential numbering in a query ChadKempel Access 3 June 4th, 2007 12:49 PM
HELP!!!!! Sequential DTS e_cabrera_g SQL Server DTS 1 October 11th, 2006 11:54 AM
Create Sequential Numbering That Does not Skip mrslockdown2003 Access 4 May 11th, 2005 11:45 AM
Sequential numbering a non auto number field dbartelt Access 3 May 5th, 2005 02:56 PM
Sequential Row numbering in queriws civa Access 5 March 7th, 2005 02:13 AM

All times are GMT -4. The time now is 07:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.