one time entry (1 Viewer)

dhoffman

Registered User.
Local time
Today, 08:10
Joined
Jul 11, 2000
Messages
69
I have a field on an entry form that I do not want being changed after the record is saved. Once this record is saved it writes some data to another table. If they delete the record that's ok because I have deletions set to be cascaded to the child table.
I thought about adding a field to the table, like a check box that would be checked once the record has been saved for the first time but I seem to think there is an easier way. Access knows if a record has been saved or not (is new or not), so is there some property I can enable to prevent editing of this single field on the form. I'll look around some more but I just couldn't find anything yet.
 

dhoffman

Registered User.
Local time
Today, 08:10
Joined
Jul 11, 2000
Messages
69
I foud a solution that seems to work but it doesn't seem like the cleanest solution to me. I set the OnGotFocus event of that field on the form to check if the record is new or not. This works whether the record is dirty or not. If the record is not new I set the field's enabled property to false, else I set it to true. Pretty slick, but I still think there should be some sort of AllowEditing property for individual fields of a record.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:10
Joined
Feb 19, 2002
Messages
43,302
The real solution would be to not duplicate data in the second table.
 

dhoffman

Registered User.
Local time
Today, 08:10
Joined
Jul 11, 2000
Messages
69
You obviously don't understand. Perhaps my explanation was insufficient. I am not duplicating any data in the second table. The value selected in the first table determines a set of 'different' values to be written to the second table in as many records as there are values in the set. These sets are editable by the user in a completely different form. To be more specific, these sets represent a group of chemical compounds. When the user selects the value in the first table he/she is specifying what set of chemical compounds a water sample was tested for. The second table has these fields: measurementID, analysisID, compoundID, TestValue. The analysisID refers to a specific water sample, basically. All the user will have to enter when the appropriate form enters is the TestValue for each compundID which was already automatically added when they updated the field I was originally talking about. Perhaps that is sufficiently explanatory as to make it clear that Pat's real solution is irrelevant.
 

Users who are viewing this thread

Top Bottom