Combo box and subform issue (1 Viewer)

Joe8915

Registered User.
Local time
Today, 02:53
Joined
Sep 9, 2002
Messages
820
I have a combo box located in the form called “Frm Add/Edit Payroll”. The combo box is “EE”
What my problem is I do not want to have the user be able to change the name in the combo box once the records have been created with the correct data using the subform. I tried changing the properties of the combo box to where “locked” = Yes. That seem to work, until I wanted to add a new EE, then of course it would not let you accomplish that.
What suggestion would you give to solve the problem?

I have attached the db to view my dilemma.
Thanks for taking the time to view my question.
 

Attachments

  • KR - WT.zip
    127.4 KB · Views: 54

boblarson

Smeghead
Local time
Today, 01:53
Joined
Jan 12, 2001
Messages
32,059
So what constitutes "correct data using the subform?" You can use the On Current event of the main form to lock/unlock the combo. So, if it is a new record

Me.Employee.Locked = (Me.NewRecord = 0)
 

Joe8915

Registered User.
Local time
Today, 02:53
Joined
Sep 9, 2002
Messages
820
Bob thanks for chiming in. If I understand you response "what constitutes "correct data using the sub form?"
I have the sub form using link Master ID on main form with Child wrkdescrp_ID on sub form

I used the following:
Me.Employee.Locked = (Me.NewRecord = 0) On Current event on the main form. I was still able to change the EE drop down from one name to another.
I then changed the field "TblEmp.Employee" to no thinking maybe that was the problem. And still the same dilemma, when adding a New EE I could not add, due to the lock = yes.

Maybe I am not explaining myself very good, which is always my problem.

Here is the bottom line:
1. I do not want the user to be able to change the name in the combo box "EE" when already selected for that record.
2. When selecting "Add EE" I want the user to be able then to select from the com box "EE".

Hell Bob, that even makes a little more sense to me.
 

Users who are viewing this thread

Top Bottom