T
Tony Williams
I have a subform that is in datasheet format. There are 3 controls
ActionDate (Source Date()), ActionTime (Source Time()), and ActionLog (Text
field). All 3 fields are locked and have this code in onCurrent event
Private Sub Form_Current()
If Me.NewRecord Then
Me.Action_Date.Locked = False
Else
Me.Action_Date.Locked = True
End If
If Me.NewRecord Then
Me.Action_Time.Locked = False
Else
Me.Action_Time.Locked = True
End If
If Me.NewRecord Then
Me.Action_Log.Locked = False
Else
Me.Action_Log.Locked = True
End If
End Sub
This works fine but the problem is as soon as I start to fill in the latest
log a new record is created in the datasheet with today's date and time.
This means that the next time I open that subform the date and tme that this
empty record was created are already there not the date and time the subform
is opened. I think I need it to stop creating a new record automatically but
default the date and time when the sub form is opened for input.
Anyone help?
Thanks
Tony
ActionDate (Source Date()), ActionTime (Source Time()), and ActionLog (Text
field). All 3 fields are locked and have this code in onCurrent event
Private Sub Form_Current()
If Me.NewRecord Then
Me.Action_Date.Locked = False
Else
Me.Action_Date.Locked = True
End If
If Me.NewRecord Then
Me.Action_Time.Locked = False
Else
Me.Action_Time.Locked = True
End If
If Me.NewRecord Then
Me.Action_Log.Locked = False
Else
Me.Action_Log.Locked = True
End If
End Sub
This works fine but the problem is as soon as I start to fill in the latest
log a new record is created in the datasheet with today's date and time.
This means that the next time I open that subform the date and tme that this
empty record was created are already there not the date and time the subform
is opened. I think I need it to stop creating a new record automatically but
default the date and time when the sub form is opened for input.
Anyone help?
Thanks
Tony