Hello everyone!
I have the following code for a multi-select list box. It worrks great, but for every record, the user has to click "Yes" to the "You are about to add one record" question. How do I get Access to stop asking that? There must be a simple answer.
Thanks!
Chris
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click
Dim varItem As Variant, strSQL As String
For Each varItem In [lstRequirements].ItemsSelected 'Loop through all selected items in the list box'
strSQL = "insert into [tblDesignUserRequirementsJoin] (DUR,[SystemNumber]) values (" & [lstRequirements].ItemData(varItem) & "," & cboSystemNumber & ")"
DoCmd.RunSQL (strSQL) 'Append a record'
Next 'Move to the next item selected in the list box'
Exit_Command16_Click:
Exit Sub
Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click
End Sub
I have the following code for a multi-select list box. It worrks great, but for every record, the user has to click "Yes" to the "You are about to add one record" question. How do I get Access to stop asking that? There must be a simple answer.
Thanks!
Chris
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click
Dim varItem As Variant, strSQL As String
For Each varItem In [lstRequirements].ItemsSelected 'Loop through all selected items in the list box'
strSQL = "insert into [tblDesignUserRequirementsJoin] (DUR,[SystemNumber]) values (" & [lstRequirements].ItemData(varItem) & "," & cboSystemNumber & ")"
DoCmd.RunSQL (strSQL) 'Append a record'
Next 'Move to the next item selected in the list box'
Exit_Command16_Click:
Exit Sub
Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click
End Sub