stopping fields in certain records being edited

TheTrainMan

Registered User.
Local time
Today, 14:16
Joined
Dec 11, 2002
Messages
18
I want to create a basic log book, OnEnter I want to put the date and time into a field (easy peasy!), I then setfocus to the next field... but how do I stop the date and time from being edited again??

Locked and enabled are for the whole field, I just want to lock each record as I go along

any ideas???
 
Hi

Not sure from your post if the date and time are being set automatically.

If not set the date & time fields as follows:

If IsNull(Me.txtDate) Then Me.txtDate= Date
If IsNull(Me.txtTime) Then Me.txtTime= Time

Code could go in the form's OnCurrent event.

hth

shay :cool:
 
Cheers Shay and Pat, I've used the single field and before update event. But is there a way I can also stop the log entry from being changed? With locked, the field locked is locked in all records... this is good for the date and using before update (but not my rubbish original way of doing it!!!), but this is totally unsuitable for the actual log entry that needs to be entered by hand in each record!!

Thanks in advance!!
 
Setting the locked property to TRUE means that the FIELD is locked... you cannot edit that field in any record. The date& time thing is no longer an issue - what I want to do is make sure that when a log entry (i.e. the log text) is entered, it cannot be edited. Could I perhaps use after update to 'archive' the log entry so that the only way to view it would be using a read only recordset??? I'm sure I'm on the right track here but not sure which direction to go in!! Any help would be greatly appreciated!! Thanks!
 
Form_Current
If IsDate(Me.YourField) Then
Me.YourField.AllowEdits =False
Else
Me.YourField.AllowEdits =True
End If
End Sub

YourField_AfterUpdate
Form_Current
End Sub
 

Users who are viewing this thread

Back
Top Bottom