R
RobUCSD
This code is in the dblck event of a lstBox called lstRNnotes. When the user
dblclks on an item I need to store it the tblRNnotes with the fldVisitNo that
is on frmRNnotes, which is linked to frmVisit by fldVisitNo.
lstVisit gets it's data from tblRNnotesLU which has canned nursing notes
I get a syntax error on the 2 lines of sql. I
would really appreciate your help with this
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
strSQL = "INSERT INTO tblRNnotes (fldRNnotes, fldVisitNo) " & _
"VALUES ('" & .ItemData(varItm) & "', " & .fldVisitNo Key & ")"
db.Execute strSQL, dbFailOnError
Next varItm
End With
dblclks on an item I need to store it the tblRNnotes with the fldVisitNo that
is on frmRNnotes, which is linked to frmVisit by fldVisitNo.
lstVisit gets it's data from tblRNnotesLU which has canned nursing notes
I get a syntax error on the 2 lines of sql. I
would really appreciate your help with this
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
strSQL = "INSERT INTO tblRNnotes (fldRNnotes, fldVisitNo) " & _
"VALUES ('" & .ItemData(varItm) & "', " & .fldVisitNo Key & ")"
db.Execute strSQL, dbFailOnError
Next varItm
End With