By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,831 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,831 IT Pros & Developers. It's quick & easy.

Turning AllowEdits to false for individual fields within a form/sub-form

P: 8
Hi Guys

I was wondering if it is possible to turn AllowEdits to false after data has been entered for individual fields within a form/sub-form. I've found that I can do this in the 'AfterUpDate' by assigning Me.AllowEdits = False .... BUT this then doesn't allow me to update data in other fields within that form/sub-form after it has been saved ... it seems to assign this property all the other fields within the form/sub-form ...

Any assistance would be greatly appreciated.

Cheers
Kate
Jul 1 '09 #1
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
You can Lock the individual fields. IF you only want to lock the field after the record is saved, use

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If IsNull(Me.YourTargetField) Then
  3.   YourTargetField.Locked = False
  4.  Else
  5.   YourTargetField.Locked = True
  6.  End If
  7. End Sub
  8.  
If you want to lock the field as soon as data is entered and the user tabs out of the field, use the above code and add this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourTargetField_AfterUpdate()
  2. If IsNull(Me.YourTargetField) Then
  3.   YourTargetField.Locked = False
  4.  Else
  5.   YourTargetField.Locked = True
  6.  End If
  7. End Sub
I have to warn you, as I do with everyone doing this kind of thing, you need to have some strategy in place for editing the field if it becomes necessary, as it almost always does!

Linq ;0)>
Jul 2 '09 #2

P: 8
Hi Linq,
Thanks heaps for your help. The fields in question are defaulted to automatically display date and time of commencement of the record ... therefore, it is important that these fields aren't altered after the record has been saved, so the record can be accurately monitored for efficiency for completion.
Thank you once again.
Kind regards
Kate
Jul 5 '09 #3

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help, Kate!

Linq ;0)>
Jul 5 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.