Question : Access - Calendar table

Hi

I want to create a table in Access containing records with all the dates for the next five years.
I don't want the user to beable to delete any of these records

Answer : Access - Calendar table

create a table called tblMyDates with a date type field called mydate

run this script

To manage the prevention of user deletion of records, you need to use a workgropu file to assign permissions to the tables in the database - i.e. record deletion for this table not allowed by users....

More information on how to achieve this is at:

http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2Fsecfaq.asp

 

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
sub filldates
 
dim dbs as database
dim rst as recordset
dim dteDate as date
 
dtedate = date() 'todays date
 
set dbs = currentdb
set rst = dbs.openrecordset("tblMyDates")
do until dtedate = 41798 'ie 08 jun 2014
 
rst.addnew
rst!mydate = dtedate
rst.update
dtedate = dtedate + 1
 
 
loop
 
rst.close
set rst = nothing
dbs.close
set dbs = nothing
 
End sub
Open in New Window Select All
Random Solutions  
 
programming4us programming4us