D
Denis
Good day,
A reply from Allen Browne to an earlier post from "Angi"
sent : 4/12/2005 11:14:16 PM on the subject: "records
aren't appending...don't see an error! " has helped me in
looking at a similar problem from a different angle.
However I am stuck on something. First, some info:
Tables: tblCV_Pers is (PK PersID) on the 'one'side of the
relationship to tblCV_PersKeywords (PK KeywordID; FK
PersID)
Forms: frmPersDetails is the Parent to sfrmCV_PersKeywords
and sfrmKeywordSelect which are both located on the same
page of a tab control (TabCtlDetails).
sfrmKeywordSelect strictly contains a listbox (lstKeywords
based on tblKeywords), which when double-clicked, will
(hopefully) populate the "[Keyword] field on
sfrmCV_PersKeywords.
Now, I have unsuccessfully tried different approaches and
I am now attempting the approach suggested by Allen and am
encountering difficulties. Here is the code I am using:
Private Sub lstKeywords_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
Set rs = Forms!frmPersDetails!
sfrmCV_PersKeywords.Form.RecordsetClone
rs.AddNew
rs!Keyword.Value = Me.lstKeywords.Value
rs.Update
Set rs = Nothing
End Sub
When I 'double-click' on lstKeywords, the item selected in
the listbox is NOT added to the [Keyword] field located on
sfrmCV_PersKeywords and I get the following error (at
which time the "rs.Update" line is highlighted:
Run-time error '3201' - "You cannot add or change record
because a related record is required in table 'tblCV_Pers'.
I have confirmed that the Link Child and Master Fields on
sfrmCV_PersKeywords are PersID.
Any help is truly appreciated.
Merçi!
Denis
A reply from Allen Browne to an earlier post from "Angi"
sent : 4/12/2005 11:14:16 PM on the subject: "records
aren't appending...don't see an error! " has helped me in
looking at a similar problem from a different angle.
However I am stuck on something. First, some info:
Tables: tblCV_Pers is (PK PersID) on the 'one'side of the
relationship to tblCV_PersKeywords (PK KeywordID; FK
PersID)
Forms: frmPersDetails is the Parent to sfrmCV_PersKeywords
and sfrmKeywordSelect which are both located on the same
page of a tab control (TabCtlDetails).
sfrmKeywordSelect strictly contains a listbox (lstKeywords
based on tblKeywords), which when double-clicked, will
(hopefully) populate the "[Keyword] field on
sfrmCV_PersKeywords.
Now, I have unsuccessfully tried different approaches and
I am now attempting the approach suggested by Allen and am
encountering difficulties. Here is the code I am using:
Private Sub lstKeywords_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
Set rs = Forms!frmPersDetails!
sfrmCV_PersKeywords.Form.RecordsetClone
rs.AddNew
rs!Keyword.Value = Me.lstKeywords.Value
rs.Update
Set rs = Nothing
End Sub
When I 'double-click' on lstKeywords, the item selected in
the listbox is NOT added to the [Keyword] field located on
sfrmCV_PersKeywords and I get the following error (at
which time the "rs.Update" line is highlighted:
Run-time error '3201' - "You cannot add or change record
because a related record is required in table 'tblCV_Pers'.
I have confirmed that the Link Child and Master Fields on
sfrmCV_PersKeywords are PersID.
Any help is truly appreciated.
Merçi!
Denis