Locking a Field after Entry

  • Thread starter Thread starter Kitty
  • Start date Start date
K

Kitty

If this duplicates, I'm sorry. I received an error when I
tried to send this the first time.

I have a time reporting database that is used by nine
people. They input their time on a form with a sub form.
The input is done on the subform.

The data input they see is in datasheet view, and is a
list of their open projects, time for the week (columns
for Mon thru Fri), and various totals and budget
information.

To add a new project, the user clicks the asterisk on the
record selector at the bottom of the subform. 98% of the
time this works great (this isn't a new process or new
users). Occasionally a user has a brain cramp and instead
of clicking to add a new project, they click on an
existing project and pick the new one from the combo box
that appears. When they do that, the time on the old
project automatically moves to the new one as the name and
project update in the underlying table.

Is there a way to prevent changing a project name once
it's been selected? I can't just lock the field on the
form as they need to be able to add new ones. Should I
use a separate form for adding a project?

Any suggestions will be welcome.

Kitty
 
Kitty said:
If this duplicates, I'm sorry. I received an error when I
tried to send this the first time.

I have a time reporting database that is used by nine
people. They input their time on a form with a sub form.
The input is done on the subform.

The data input they see is in datasheet view, and is a
list of their open projects, time for the week (columns
for Mon thru Fri), and various totals and budget
information.

To add a new project, the user clicks the asterisk on the
record selector at the bottom of the subform. 98% of the
time this works great (this isn't a new process or new
users). Occasionally a user has a brain cramp and instead
of clicking to add a new project, they click on an
existing project and pick the new one from the combo box
that appears. When they do that, the time on the old
project automatically moves to the new one as the name and
project update in the underlying table.

Is there a way to prevent changing a project name once
it's been selected? I can't just lock the field on the
form as they need to be able to add new ones. Should I
use a separate form for adding a project?


You can use the form's Current event to lock the control
except for new records:

Me.cboProject.Locked = Not Me.NewRecord
 
Thanks, Marsh. This works perfectly for locking the field
for changes.

Do you have suggestions for enabling it? They can still
get the drop down on existing projects, though can't
change it. Is there a way to keep them from the field
altogether? I tried the same code substituting Enabled
for locked, and it didn't do.

Thanks for your prompt response.

Kitty
 
Back
Top