Preventing change in records

D

Diogo

Hi
I'm using command buttons with macros assigned (now function), to enter data
in specific fiels (time in and time out).
Every time a user opens the form it shows its last enterd records.
I only want user to be able to enter new data to empty fields.
How do i prevent users from clicking the macros buttons and inserting new
data to records already field.
Thanks in advanced.
 
M

mscertified

I'd stop using macros and use a vb event procedures instead.
Then in the 'OnClick' event for the button you can put something like:

IF isnull(Me!MyTime) Then
Me!MyTime = Now()
else
msgbox "You can't overlay an existing time"
end if

Dorian
 
P

pietlinden

mscertified said:
I'd stop using macros and use a vb event procedures instead.
Then in the 'OnClick' event for the button you can put something like:

IF isnull(Me!MyTime) Then
Me!MyTime = Now()
else
msgbox "You can't overlay an existing time"
end if

Dorian

Open the form in Add mode. then you can't access the existing records
and modify them.

DoCmd.OpenForm "Customers", acNormal, , , acFormAdd
 
Top