Text box validation question, please help!

  • Thread starter Thread starter Byron
  • Start date Start date
B

Byron

Guest
At present I have existing data being displayed in text boxs. My requirement is to be able to view this data but not be able to edit it.(ok just lock the field) but the problem is that I need to be able to add new records and thus be able to input data into the text boxs which wont be allowed if it is locked.
So basically not allow editing to existing records but allow new records to be added. Not sure if that makes sense, it seems like some sort of validation issue, can anyone help. Cheers
 
If you don't want your fields to be edited, open your form with:

Code:
DoCmd.OpenForm "Formname",,,,acFormReadOnly

If you want to add a new record:

Code:
docmd.OpenForm "Formname",,,,acFormAdd

Just reset the settings of your field to Locked = False, else the acFormAdd mode won't work I think.

Seth
 
So where do I put this code in, sorry bit of a novice
 

Users who are viewing this thread

Back
Top Bottom