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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |