G
Guest
Hello.
I have a situation where a value from a combo box (named cboPayPeriod on a
Main form; source is form tblPayPeriods) needs to copy to a subform field
(named fkPerID). The code is as follows (but does not save the value):
If IsNull (Me!fkPerID) Then
Me!fkPerID = Me.Parent!cboPayPeriod
End If
When I try to save a record I get the following error: "You cannot add or
chnage a record because a related record is required in table 'tblPayPeriods'"
My DB is properly normalized (tblPayPeriods is linked to the Overtimefile
via the PerID fiield with PerID on the one side and fkPerID on the manyside),
but for some reason the value from the combo box won't transfer to the
flPerID field in the sub form. However, when I manually enter in a valid ID
number from tblPayPeriods, the record saves OK.
Any suggestions on what is happening here?
Thank you kindly (I'm very pressed for time to complete this project and any
assitance would be appreciated).
Mark
I have a situation where a value from a combo box (named cboPayPeriod on a
Main form; source is form tblPayPeriods) needs to copy to a subform field
(named fkPerID). The code is as follows (but does not save the value):
If IsNull (Me!fkPerID) Then
Me!fkPerID = Me.Parent!cboPayPeriod
End If
When I try to save a record I get the following error: "You cannot add or
chnage a record because a related record is required in table 'tblPayPeriods'"
My DB is properly normalized (tblPayPeriods is linked to the Overtimefile
via the PerID fiield with PerID on the one side and fkPerID on the manyside),
but for some reason the value from the combo box won't transfer to the
flPerID field in the sub form. However, when I manually enter in a valid ID
number from tblPayPeriods, the record saves OK.
Any suggestions on what is happening here?
Thank you kindly (I'm very pressed for time to complete this project and any
assitance would be appreciated).
Mark