K
kdw
I have a Main form with 3 tabs. Tab1 contains fields that's part of the Main
form, and Tab2 and Tab3 contain 2 different subforms. The Main form contains
fields for entering employee info and Tab2 and Tab3 let the user enter
actvities.
I have 2 problems, which may or may not be related:
1. One of the fields on Tab1 is a lookup combo box that lets the user pick
the ProgramType the employee belongs to. It's not required. but if I don't
pick a value and I click on Tab2 or Tab3, I get the error "You can not add or
change a record because a related record is required in the table
tblProgramType." I understand that when I move off the Main form (by going
to Tab2 or Tab3) that Access automatically saves the record, but this error
confuses me. If I make a combobox selection, then everything is fine. Why?
2. Related to the #1, I tried to have a FormCheck procedure that check for
valid entries before letting the record be saved (for example, when I move
off the Main form into the subform). If I am going to get the above error, I
want to put in a friendlier message to tell the user to pick a value. but I
can't seem to find the right Event to put the code in. I have tried
BeforeUpdate, LostFocus. Subform OnEnter is too late. Any suggestions?
Thank you!
form, and Tab2 and Tab3 contain 2 different subforms. The Main form contains
fields for entering employee info and Tab2 and Tab3 let the user enter
actvities.
I have 2 problems, which may or may not be related:
1. One of the fields on Tab1 is a lookup combo box that lets the user pick
the ProgramType the employee belongs to. It's not required. but if I don't
pick a value and I click on Tab2 or Tab3, I get the error "You can not add or
change a record because a related record is required in the table
tblProgramType." I understand that when I move off the Main form (by going
to Tab2 or Tab3) that Access automatically saves the record, but this error
confuses me. If I make a combobox selection, then everything is fine. Why?
2. Related to the #1, I tried to have a FormCheck procedure that check for
valid entries before letting the record be saved (for example, when I move
off the Main form into the subform). If I am going to get the above error, I
want to put in a friendlier message to tell the user to pick a value. but I
can't seem to find the right Event to put the code in. I have tried
BeforeUpdate, LostFocus. Subform OnEnter is too late. Any suggestions?
Thank you!