I use the folllowing code to pass a control name to the AddRecords sub procedure.
I get the following error message: "Object Doesn't Support this Property or Method"
on the AddRecords Application, Forms![Enter Key Words]!
lst_applications.
What is causing this error message?
Sub cmd_enter_key_words_Click()
If txtAppSelected <> "" Then
AddRecords Application, Forms![Enter Key Words]!
lst_applications
MsgBox ("Records Added"
End If
End Sub
Sub AddRecords(category_temp As String, ctlSource As Control)
Dim keyword_temp As String
Dim intCurrentRow As Integer
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
keyword_temp = ctlSource.Column(0,
intCurrentRow)
DoCmd.RunSQL "(INSERT INTO KeyWords
(spcr_number, category, keyword) VALUES
(Forms![Enter Key Words]!
lst_spcr_number], '" & category_temp
& "', '" & keyword_temp & "'))"
End If
Next intCurrentRow
End Sub
thank you for your response.
I get the following error message: "Object Doesn't Support this Property or Method"
on the AddRecords Application, Forms![Enter Key Words]!
lst_applications.
What is causing this error message?
Sub cmd_enter_key_words_Click()
If txtAppSelected <> "" Then
AddRecords Application, Forms![Enter Key Words]!
lst_applications
MsgBox ("Records Added"
End If
End Sub
Sub AddRecords(category_temp As String, ctlSource As Control)
Dim keyword_temp As String
Dim intCurrentRow As Integer
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
keyword_temp = ctlSource.Column(0,
intCurrentRow)
DoCmd.RunSQL "(INSERT INTO KeyWords
(spcr_number, category, keyword) VALUES
(Forms![Enter Key Words]!
lst_spcr_number], '" & category_temp
& "', '" & keyword_temp & "'))"
End If
Next intCurrentRow
End Sub
thank you for your response.