G
Guest
I get the following error w/ the code below. Can someone help me with
figuring out how to insert the current VisitNo (fldVisitNo) that is linked to
RNnotes into the equation below. Thanks Robert
Error 3201 You cannot add or change a record because a related record is
required in table "tblVisit."
Dim db As DAO.Database
Dim strSQL As String
Dim varItm As Variant
Set db = CurrentDb()
With Forms!frmRNnotes!lstRNnotesLU
For Each varItm In .ItemsSelected
CurrentDb.Execute ("INSERT INTO tblRNnotes (fldRNnotes) " _
& "VALUES ('" & .ItemData(varItm) & "');"), dbFailOnError
Next varItm
End With
Debug.Print
figuring out how to insert the current VisitNo (fldVisitNo) that is linked to
RNnotes into the equation below. Thanks Robert
Error 3201 You cannot add or change a record because a related record is
required in table "tblVisit."
Dim db As DAO.Database
Dim strSQL As String
Dim varItm As Variant
Set db = CurrentDb()
With Forms!frmRNnotes!lstRNnotesLU
For Each varItm In .ItemsSelected
CurrentDb.Execute ("INSERT INTO tblRNnotes (fldRNnotes) " _
& "VALUES ('" & .ItemData(varItm) & "');"), dbFailOnError
Next varItm
End With
Debug.Print