G
Guest
Access 2003 - Windows XP SP2
Users are supposed to use a combo box at the top of a form I created to
search for a person's name. Sometimes they do not do this.
In order to stop people from accidently wiping out certain info on a form
when searching therefore (in addition to training), I want to set the last
and first name fields to ENABLED = NO, LOCKED=YES and shade the field to
another background color. I want to unlock and enable the fields for data
entry though.
I set the fields on the control properties accordingly. In the BEFORE
INSERT event on the form, I added code to set the background color to white,
ENABLED to YES, and LOCKED to NO. I also set the .setfocus to the last name
field where I want it. Same code for three fields.
When I add this code, and test it by hitting the add record navigation
button, the fields background colors do not change, the setfocus event goes
to the wrong field and one in a subform, and the fields are still locked.
It is in add mode though.
Should I not use the form's before insert event? How do I get the fields
to properly unlock, reshade, and set focus during add?
Users are supposed to use a combo box at the top of a form I created to
search for a person's name. Sometimes they do not do this.
In order to stop people from accidently wiping out certain info on a form
when searching therefore (in addition to training), I want to set the last
and first name fields to ENABLED = NO, LOCKED=YES and shade the field to
another background color. I want to unlock and enable the fields for data
entry though.
I set the fields on the control properties accordingly. In the BEFORE
INSERT event on the form, I added code to set the background color to white,
ENABLED to YES, and LOCKED to NO. I also set the .setfocus to the last name
field where I want it. Same code for three fields.
When I add this code, and test it by hitting the add record navigation
button, the fields background colors do not change, the setfocus event goes
to the wrong field and one in a subform, and the fields are still locked.
It is in add mode though.
Should I not use the form's before insert event? How do I get the fields
to properly unlock, reshade, and set focus during add?