Is this Possible? (limiting modification of existing data entries

C

Christopher

At my work place we have a log book to track incoming and outgoing
shipments. I'm trying to design a Access Database to preform the same
function but can't think of a solution to a fundamental problem- the
prevention of unauthorized/accidental changes to the data. Ideally what I
would like to do is to modify the 'auto save' feature of Access to not only
save but to save each time as an additional file automatically. I guess what
I want to know is: Is it possible to make it so that once you create an entry
to the database that you cannot modify any of the fields for that entry? I'm
using Office 2007.
 
S

Stefan Hoffmann

hi Christopher,
I want to know is: Is it possible to make it so that once you create an entry
to the database that you cannot modify any of the fields for that entry? I'm
using Office 2007.
Yes, use two forms one for data entry and one form browsing data to
simplify the coding.

http://msdn.microsoft.com/en-us/library/aa223265(office.11).aspx

Control the behavior of your forms with the properties AllowEdits,
AllowDeletions, AllowAdditions and DataEntry in the Form Open event.


mfG
--> stefan <--
 
C

Crystal (strive4peace)

Hi Christopher,

"Is it possible to make it so that once you create an entry
to the database that you cannot modify any of the fields for that entry?"

yes -- you can use the Form Current event to test if the record is a New
Record -- if it is, then allow changes to the controls and if it is not,
then don't.

Assuming you will Lock or Unlock ALL the controls in the detail section:

'~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Current()
On Error GoTo Proc_Err

Dim ctl As Control

For Each ctl In Me.Detail.Controls
ctl.Locked = Not Me.NewRecord
Next ctl

Proc_Exit:
Set ctl = Nothing
Exit sub

Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " Form_Current: " & Me.Name
Resume Proc_Exit

'if you want to single-step code to find error, CTRL-Break at MsgBox
'then set this to be the next statement
Resume
end Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal
remote programming and training

http://www.YouTube.com/user/LearnAccessByCrystal

Access Basics
http://www.AccessMVP.com/strive4peace
free 100-page tutorial that covers essentials in Access

*
:) have an awesome day :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top