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

Disabling fields

P: 68
I have created a form with a few tabs for data entry. The first tab contain fields that i want to disable after data is entered and saved. that is a person comming after to enter data into that form should not be able to change the data they meet. the fields on the tab are combo boxes and and text boxes.
please help
Feb 7 '08 #1
Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,186
There are various properties for each control (fields are items in a record - controls are items on a form or report). Check out the Locked and Enabled properties for what you want.
Feb 7 '08 #2

P: 68
I cannot use that since i do want people to enter data in the fields iniatially. what i want is for them not to be able to change the data after they would have move to a new record, nor should they be able to alter something that someone else had entered in those fields.
Feb 8 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
NeoPa's advice is the only way you can do this, if, as your post suggests, you want to be able to view existing records as well as add new records! You simply have to use the properties conditionally. If , when moving to a record, a field already has data in it, lock it. Otherwise, leave it unlocked.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.    If Not IsNull(Me.TextBoxName) Then
  3.      TextBoxName.Locked = True
  4.    Else
  5.      TextBoxName.Locked = False
  6.    End If
  7. End Sub
Welcome to TheScripts!

Linq ;0)>
Feb 8 '08 #4

P: 68
Dear wizzard of this barn
It worked like a charm
did no harm
once again I can yarn
thanks for the helping arm

Linq
Feb 8 '08 #5

NeoPa
Expert Mod 15k+
P: 31,186
Nice to have some poetry in here :)
BTW I edited your post as you seemed to be signing it as Linq rather than addressing it to him (that is his signature rather than his handle when done with the smiley).
Feb 9 '08 #6

Post your reply

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