DataBase - How to set field so it is read only

Asked By Jack
21-Nov-09 02:23 AM
On a master form how do you set the field so that it is read only (data can
not be changed)?
--
Thank you,  Jack
AllowEdits
(1)
Stafford
(1)
Sheridan
(1)
Textbox
(1)
  Jeanette Cunningham replied to Jack
21-Nov-09 06:09 AM
If you want a text box to be read only, you set its Locked property to Yes
(on the Data tab of its property sheet).

If you want all data on the form to be readonly, you set AllowEdits to No.
Then you do not have bother with setting the textbox to locked.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
  KenSheridan via AccessMonster.com replied to Jack
21-Nov-09 07:54 AM
If you also set a control's Enabled property to False (No) as well as its
Locked property to True (Yes) the user will not be able to move focus to the
control.  Setting the Enabled property to False without making the Locked
property True has the same effect, but in this case the control's background
is greyed out, whereas setting both leaves its appearance as normal.

One thing to be aware of if setting a form's AllowEdits property to False is
that, not only will this make any bound controls read only, but it will also
disable any unbound controls such as an unbound combo box for selecting a
record to move to for instance.  So if you want the bound controls to be non-
editable, but to have unbound controls available to the user disable/lock the
relevant bound controls individually.

Ken Sheridan
Stafford, England


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200911/1
  Jack replied to KenSheridan via AccessMonster.com
21-Nov-09 03:43 PM
Thanks a lot.  It seem so easy when someone knows what they are doing.
--
Thank you,  Jack
Create New Account
help
strMessage As String Dim rsMyRs As Recordset, dbMyDB As Database Debug.Print "cmb_HeaderSelect2 = "; Cmb_HeaderSelect2 Me.AllowEdits = True: Me.AllowAdditions = True: Me.AllowDeletions = True Set dbMyDB = CurrentDb strMessage = "Do you want to the Control Source for Display Box 3 Call AfterUpdate_Process1("StoreName", NewData, 2, cmb_HeaderSelect3, "0034") Me.AllowEdits = True: Me.AllowAdditions = False: Me.AllowDeletions = False End Sub Is my thinking all wrong here form's AfterInsert event procedure requery the combo box with: Me.[cmb_Find_Box]_3.Requery Ken Sheridan Stafford, England Hi Ken. Thanks for this but when I try to run the routine i you don't want to see them set their Visible property to False (No). Ken Sheridan Stafford, England Hi ken Thanks for this but after I sent you the reply, I worked Visible = True DoCmd.GoToRecord acForm, Me.Name, acNewRec At the begining I have added Me.AllowEdits = True: Me.AllowAdditions = True: Me.AllowDeletions = True and the coverse at the end I must controls then changing the value in one should automatically be reflected in the other. Ken Sheridan Stafford, England Ken, your a wizard, thanks. I though I should re-set the forms
Thanks! Access Getting Started Discussions ACCESS (1) MS (1) AllowInserts (1) AllowAdditions (1) MVP (1) AllowEdits (1) CompuServe (1) VBA (1) Simply set the Allow Updates and Allow Inserts properties of John W. Vinson [MVP] You wouldn't find Allow Updates or AllowInserts. John actually meant AllowEdits and AllowAdditions. Leave the former as 'Yes', change the latter to 'No' and change the correcting one of my early mentors from the old CompuServe MS Access forum days {:-)> . Ken Sheridan Stafford, England I will see YOU at the summit, young whippersnapper! <bg> John W. Vinson [MVP
does not complete until Monday morning. How do I calculate that time? Access Discussions Ken Sheridan Stafford England John W. Vinson (1) Ken Sheridan Stafford England Message (1) Ken Sheridan Stafford England (1) TimeValue (1) Decimal (1) Module (1) Date (1) DateDiff (1) Try something like this: DateDiff("h", IIf(WeekDay([DateTimeStart]) = 6, [DateTimeStart]+2, [DateTimeStart]), [DateTimeEnd]) Ken Sheridan Stafford, England - - Message posted via AccessMonster.com http: / / www.accessmonster.com / Uwe / Forums.aspx / access / 201004
DataBase I omitted that I am using Office 2003. Access Discussions Original (1) Thread (1) Sheridan (1) Stafford (1) Omitted (1) England (1) Access (1) Office (1) Everything we said in your original thread should be fine with that. Ken Sheridan Stafford, England keywords: Access, data, to, text, file, list description: I omitted that I am using