locking the contents when viewing

saleemMSMS

Registered User.
Local time
Today, 17:20
Joined
Aug 12, 2009
Messages
92
hi
how can i lock the fields in a form when viewing contents but to unlock them when adding a new record ?? is it possible if yes, how ?:cool:
 
Yes you can. You can set the form's Allow Edits property to No this will prevent the editing of existing records but allow the addition of new records.
 
Try:

Code:
Private Sub Form_Current()

  Me.AllowEdits = Me.NewRecord

End Sub
 
hey thank you very much HiTechCoah !! you are a real problem solver !! :)
also thanx John Big Booty for the quick response.. ;-)

hey theres another problem. say if i include a button in the form saying "edit" which will make the current record editable, then what code should i write in the button click event ?
 
hey i think i got it..
its
Me.AllowEdits = True
right ?
 
Code:
Me.AllowEdits = True
Will allow existing records to be edited and new records to be added. Whilst;
Code:
Me.AllowEdits = False
Will prevent existing records being edited whilst you will still be able to add new records.
 

Users who are viewing this thread

Back
Top Bottom