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

Is there a Way to Make a Archive Dbase ReadOnly?? 1

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Good afternoon, folks. I have two dbases, the first is the working dbase, where everything is done, and I have a second dbase, which is for archived records. I have the tables from the archive dbase linked to the working dbase. In the working dbase, I have an autoexec macro, which runs a delete query to delete all records in the archive dbase which are 3 years old or older. I would like to make sure that no one can modify the records in the archive dbase, so what I need to know is there a way to make the archive dbase Read Only, but still be able to delete the three year old records with the macro? Thank you in advance to anyone offering assistance on the my last problem, I hope.
 

You'll need to convert your macro to VB code. Within your VB code you can set your archive database as an active data base so that it can allow updates and then when it finishes it can reset the database to read only again.

 
Thank you for the response, kphu. Bear with me on this one, sense I just spent a day and a half kicking and tweaking those macros, I am a little hesitant. First, do I convert the AutoExec macro only? Or do I also convert the macExitAccess macro, which has the append queries and one delete query in it? Next how do I set the archive to an active dbase? And how do I reset it to read- only? Last of all where would I run the VB code? I have had a lot of trouble find locations to run these queries as it is. I have just finished five days of final debugging this monster, so I am not exactly at my best right now. Thank you for the assistance.
 
kphu, I just discovered something and I was just wondering, wouldn't changing these three properties in the forms property sheet do what I would like to do? These are the changes:
AllowEdits -> NO
AllowAdditions -> NO
AllowDelletions -> NO
Sense the only way for users to view the records is thru one of two forms, wouldn't this keep people from changing the records? Thank you again for the assistnace.
 
Quest4,

I understand your concern in regards to converting the macros to VB. I would create a backup copy of your db before you make any changes.

Actually, since you mentioned that there is only 2 forms then the allow edit, additions, deletions property is the way to go. This will make it easier since you probably won't need to convert the macros.

What you will have to do is write the code to change the properties to Yes when it opens and no before it closes.

The coding is easy and can be done in a button.

How do you execute your macro's right now? in 1 button or many buttons?

 
Thank you for the response, kphu. I have already tried a couple fuction attempts yesterday and they bombed out royally. The macros are run automatically on exit by replacing the exit on the switchboard with a run macro instead. The AutoExec is also being used to execute a delete query. It isn't that I am afraid of VB, I just finished off put about 6 MB of it into the monster. I am afraid of more code screwing up what is now in there and working correctly. This has been one heck of a project that I got myself into, it started as one thing and turned into something else the some of my co-works thought that I didn't have enough to do so they added things to this. Well, in the AM the testing begines and next week, if al goes well it goes on line. It is great to be done, thanks for the assistance.
 
Quest4,

It occurred to me that you won't need to make any changes to your current database. I'm assuming that your macros are working directly with the tables and not the forms. So for the archive database just set the form properties Allow edits, deletions, additions to no and that's all you would need to do.

Ken
 
Thank you again, kphu. I have just finished doing just that. I did find out from a friend, only set the AllowEdits to NO and leave the AllowAdditions set to YES and leave the AllowDeletions set to yes. I was told about a querk in Access where the records actually disappear in the form when the last two items are checked. So I reset everything and it is running great for now. Thanks agin for the assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top