A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to prevent records from editing or deletion



 
 
Thread Tools Display Modes
  #1  
Old August 26th, 2005, 07:48 AM
mhmaid
external usenet poster
 
Posts: n/a
Default how to prevent records from editing or deletion

hi
i have my Patients form in which i enter Patients details including expenses
..so i want a to have a button to protect a record from editing or
deletion.and at the same time have the option to unprotect it or even delete
it. this will prevent editing records of previous year/s which may a user do
by mistake ( as one patient may have many records because for each travel he
will have a new record.)
  #2  
Old August 26th, 2005, 11:28 AM
Ofer
external usenet poster
 
Posts: n/a
Default

On the oncurrent event of te form, you can check for the year , and lock the
records according

Private Sub Form_Current()
If Year(Me.DateField) Year(date()) Then
Me.AllowDeletions = False
Me.AllowEdits = False
Else
Me.AllowDeletions = True
Me.AllowEdits = True
End If
End Sub


"mhmaid" wrote:

hi
i have my Patients form in which i enter Patients details including expenses
.so i want a to have a button to protect a record from editing or
deletion.and at the same time have the option to unprotect it or even delete
it. this will prevent editing records of previous year/s which may a user do
by mistake ( as one patient may have many records because for each travel he
will have a new record.)

  #3  
Old August 26th, 2005, 04:03 PM
mhmaid
external usenet poster
 
Posts: n/a
Default



thanks ofer.
i have tried this.my question now is how to unprotect a record .how to get
access to one of the protected records.actually, i have two tables .one is
Patients which will hold patients personal inf and medical.the other is
exense reports which will hold the expenses.i am receiving invoices batches
and have to account.after entering each batch(which will have manual no) i
print the expense details entered for that batch which should tally with the
total amt of invoices. so , when i make sure the amount is tying up , at that
stage i want to have option to protect these records ( which are in the
subform of the main Patients form) from being edited or deleted.of course
this is regardless of the protection of the main form.because i may receive
invoices for a particular patient after one or two years only, which
according to the event proc.you gave me , will be protected.

thank you

 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing or adding records in a form tiz Using Forms 11 July 31st, 2007 10:02 PM
Able to make contacts READ-ONLY to prevent accidental deletion NigelKH Contacts 0 June 20th, 2005 02:00 PM
Prevent editing read-only files? David Beraha General Discussion 1 June 7th, 2005 01:23 PM
Prevent from duplicate records Ray Using Forms 5 April 4th, 2005 05:53 PM
append Query duplicating records Alex Running & Setting Up Queries 1 July 8th, 2004 01:31 PM


All times are GMT +1. The time now is 09:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.