S
sljack63
I must have lost my mind because I can't figure this out:
tblShows has a one-to-many relationship with tblAgilityRec.
I have a form based on a qry that includes tblShows and various other
tables. I added a button to the form that opens a form based on a qry
that only includes the tblAgilityRec. The code is:
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Me.CompType
Case "Agility"
stDocName = "fsubAgilityRec"
Case "Rally"
stDocName = "frmRallyRecord"
End Select
stDocName = "fsubAgilityRec"
stLinkCriteria = "[ShowNo]=" & Me![ShowNo]
stDocName = "fsubAgilityRec"
DoCmd.OpenForm stDocName, , , stLinkCriteria
My problem is that when I attempt to add a new record to the form
"fsubAgilityRec" I get a message that reads:
"You cannot add or change a record because a related record is required
in table 'tblShow'.
What am I doing wrong here?
tblShows has a one-to-many relationship with tblAgilityRec.
I have a form based on a qry that includes tblShows and various other
tables. I added a button to the form that opens a form based on a qry
that only includes the tblAgilityRec. The code is:
Dim stDocName As String
Dim stLinkCriteria As String
Select Case Me.CompType
Case "Agility"
stDocName = "fsubAgilityRec"
Case "Rally"
stDocName = "frmRallyRecord"
End Select
stDocName = "fsubAgilityRec"
stLinkCriteria = "[ShowNo]=" & Me![ShowNo]
stDocName = "fsubAgilityRec"
DoCmd.OpenForm stDocName, , , stLinkCriteria
My problem is that when I attempt to add a new record to the form
"fsubAgilityRec" I get a message that reads:
"You cannot add or change a record because a related record is required
in table 'tblShow'.
What am I doing wrong here?