S
spowell15
Hi All,
I am trying to run an Update query in SQL to a memo field. I get the
error message 'Item not found in this collection'. I have posted my
code below. Anyone got any ideas what I am doing wrong? Any help
would be greatly appreciated.
Dim db As DAO.Database
Dim qd As DAO.QueryDefs
Dim strSQL As String
Set db = CurrentDb
Set qd = db.QueryDefs("strSQL")
qd!Parameters("ActDate") = "[Forms]![Action_Diary_frm]![Action Date]"
qd!Parameters("ActTaken") = "[Forms]![Action_Diary_frm]![Action
Taken]"
qd!Parameters("Coms") = "[Forms]![Action_Diary_frm]![Comments]"
db.QueryDefs("strSQL").Execute
strSQL = "UPDATE [Action_Diary] SET [Action_Diary].[Action Date] =
[Act], [Action_Diary].[Action Taken]=
[ActTaken],[Action_Diary].[Comments] = [Coms] WHERE
[Action_Diary].[Action_ID] = [Forms]![Action_Diary_frm]![Action_ID] "
Thanks,
Shirley
I am trying to run an Update query in SQL to a memo field. I get the
error message 'Item not found in this collection'. I have posted my
code below. Anyone got any ideas what I am doing wrong? Any help
would be greatly appreciated.
Dim db As DAO.Database
Dim qd As DAO.QueryDefs
Dim strSQL As String
Set db = CurrentDb
Set qd = db.QueryDefs("strSQL")
qd!Parameters("ActDate") = "[Forms]![Action_Diary_frm]![Action Date]"
qd!Parameters("ActTaken") = "[Forms]![Action_Diary_frm]![Action
Taken]"
qd!Parameters("Coms") = "[Forms]![Action_Diary_frm]![Comments]"
db.QueryDefs("strSQL").Execute
strSQL = "UPDATE [Action_Diary] SET [Action_Diary].[Action Date] =
[Act], [Action_Diary].[Action Taken]=
[ActTaken],[Action_Diary].[Comments] = [Coms] WHERE
[Action_Diary].[Action_ID] = [Forms]![Action_Diary_frm]![Action_ID] "
Thanks,
Shirley