P
Pamela
I have tblClaim with ClaimID (PK) and tblIntParty with PartyID (PK), both
Autonumber fields, which needs to be a many-to-many as each claim can have
several parties and each party can have multiple claims. I, therefore, made
a junction table tblClaimIntParty with both the ClaimID and PartyID as a dual
PK. I now have a command button on frmClaim to open frmIntParty but am
getting the error "Cannot add record(s); join key of table 'tblClaimIntParty'
not in recordset." I noticed that when the frmIntParty opens, it still shows
"Autonumber" in the PartyID field. Nothing I've found yet on junction tables
tells you what further to do with it... any help would be great!!
Here is the code for the command button:
Private Sub CBOpenIntParty_Click()
On Error GoTo Err_CBOpenIntParty_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInterestedParty"
stLinkCriteria = "[ClaimID]=" & Me![ClaimID]
DoCmd.OpenForm stDocName, , , , acFormAdd, , Me![ClaimID]
Exit_CBOpenIntParty_Click:
Exit Sub
Err_CBOpenIntParty_Click:
MsgBox Err.Description
Resume Exit_CBOpenIntParty_Click
End Sub
Here is the code for the OnLoad event of the frmIntParty:
Private Sub Form_Load()
Me.ClaimID = Me.OpenArgs
End Sub
TIA!
Pamela
Autonumber fields, which needs to be a many-to-many as each claim can have
several parties and each party can have multiple claims. I, therefore, made
a junction table tblClaimIntParty with both the ClaimID and PartyID as a dual
PK. I now have a command button on frmClaim to open frmIntParty but am
getting the error "Cannot add record(s); join key of table 'tblClaimIntParty'
not in recordset." I noticed that when the frmIntParty opens, it still shows
"Autonumber" in the PartyID field. Nothing I've found yet on junction tables
tells you what further to do with it... any help would be great!!
Here is the code for the command button:
Private Sub CBOpenIntParty_Click()
On Error GoTo Err_CBOpenIntParty_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInterestedParty"
stLinkCriteria = "[ClaimID]=" & Me![ClaimID]
DoCmd.OpenForm stDocName, , , , acFormAdd, , Me![ClaimID]
Exit_CBOpenIntParty_Click:
Exit Sub
Err_CBOpenIntParty_Click:
MsgBox Err.Description
Resume Exit_CBOpenIntParty_Click
End Sub
Here is the code for the OnLoad event of the frmIntParty:
Private Sub Form_Load()
Me.ClaimID = Me.OpenArgs
End Sub
TIA!
Pamela