Preventing change in records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top