How to Make Loop for ListBox to Send Bulk SMS in Access 2016/19

Ghulam Murtaza 21 Reputation points
2021-01-27T14:28:20.76+00:00

Hello Everyone!
I want to make a loop for Listbox with Mobile Numbers to send SMS to all of them
MS Access 2016/19
I can send an SMS Successfully by selection to single MobileNumber in Listbox.

If I want to send SMS to all Numbers by Selection it sends all sms to one first mobile number.
Please help me.
Here is code for loop sending sms

Private Sub Command41_Click()
Dim x As Integer
For x = 0 To Me.Listbox1.ListCount - 1
Debug.Print Listbox1.ItemData(x)
''Send SMS command
Call cmdSendSMS_Click
Next x
End Sub

0 comments No comments
{count} votes

Accepted answer
  1. HansV 966 Reputation points MVP
    2021-01-27T14:54:27.553+00:00

    Does this work?

        Private Sub Command41_Click()
            Dim x As Integer
            For x = 0 To Me.ListBox1.ListCount - 1
                Debug.Print ListBox1.ItemData(x)
                Me.ListBox1.ListIndex = x
                ''Send SMS command
                Call cmdSendSMS_Click
            Next x
        End Sub
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.