Page 1 of 4 1234 LastLast
Results 1 to 40 of 146

Thread: [RESOLVED] sending sms with listview and checkbox in listview

  1. #1

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Resolved [RESOLVED] sending sms with listview and checkbox in listview

    hello everyone
    this is a little hard
    i have a form that sends sms ok?
    now i also i have listview with a checkbox in the same form
    what i want to do is to send 1 sms or to all sms from a text1.text
    that i write the message (text1.text)
    and i pick the person from the listview that this will send the message.
    the code of the message i already have
    i just want to be able to choose from a listview the contact and send him a message in what i write in the (text1.text)
    i hope im understood
    *****************
    this is what i have in the mail form where i send emails from a listview
    Dim SendToAll As String, NoEmails As Boolean

    LsVw.SetFocus
    NoEmails = True
    For I = 1 To LsVw.ListItems.Count
    If LsVw.ListItems(I).Checked And Len(Trim$(LsVw.ListItems(I).SubItems(1))) <> 0 Then
    SendToAll = SendToAll & LsVw.ListItems(I).SubItems(1) & "; "
    NoEmails = False
    End If
    Next
    If Not NoEmails Then ShellExecute hwnd, "open", "mailto:" & SendToAll, vbNullString, vbNullString, SW_SHOW
    Unload Me
    Last edited by salsa31; May 26th, 2012 at 08:20 AM.

  2. #2
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    try doing it this way ...
    Attached Files Attached Files

  3. #3

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this listview is displaying data from the data base
    this is a barber programm.
    you have mybe another idea?

  4. #4
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    the sms data in list is name or numbers ? , load data from database to list1 and then select the recivers list which will be add to list 2 , then send sms to list of list 2

  5. #5

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    the sms data i write in a text1
    now i have a database which i store customers.
    this is the sms form.
    I dont know what do.
    im stuck here
    please any ideas for me
    Last edited by salsa31; May 27th, 2012 at 05:53 AM.

  6. #6
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    plz upload ur and attach ur form .. i shall see the list method

  7. #7

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by useruseronline View Post
    plz upload ur and attach ur form .. i shall see the list method
    to upload only the sms form you meen

  8. #8
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    ya tha form which u explained

  9. #9

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this is the form of the sms

  10. #10

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this is the access file that i store the custs
    hair.mdb

  11. #11
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    this is the form of the sms
    this is not the form u showed in picture .... there is no listbox

  12. #12

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this is not a list box i use a listview

  13. #13
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    this is not a list box i use a listview
    use list box it will be easy

  14. #14

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    and this is the method i use to show the custs from the database
    LsVw is Listview
    **********************
    Set RS = CN.Execute("SELECT * FROM Customers")

    LsVw.ListItems.Clear
    While Not RS.EOF
    Set Itm = LsVw.ListItems.Add(, , RS!FullName)
    Itm.Bold = True
    Itm.SubItems(1) = RS!Cellular

    RS.MoveNext
    Wend
    If LsVw.ListItems.Count = 0 Then



    MsgBox " no custs ", vbInformation
    End If
    if you can show me how to do it with a listbox that will be great

  15. #15

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    can you show me an example plz?

  16. #16
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    http://www.vb-helper.com/howto_net_db_load_listbox.html

    it shows how to add data from database to listbox

  17. #17

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this is vbnet
    you posted here something erarlier that can be good
    load data from database to list1 and then select the recivers list which will be add to list 2 , then send sms to list of list 2.
    i never worked with listbox
    can you show me an example or help me with this code plz?

  18. #18
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    i know to do it with data from textfile will it be ok ?

  19. #19

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    yes anything will be ok as long as i can choose from the textfile to which i can send sms or to send to all

  20. #20
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    Code:
    Option Explicit
    Private Sub Form_Load()
    Open "C:\Downloads\b.txt" For Input As #1
    Dim filesize As Integer
    filesize = LOF(1)
    Text1 = Input(filesize, #1)
    Text1.Visible = False
    Close #1
        
        '~~~ When a button is pressed
       
            Dim temp() As String
            temp = Split(Text1.Text, vbCrLf)    '~~~ Split the lines in the TextBox, separated by a vbCrLf character(newline) and store it in the array
           
            '~~~ Loop through the array
            Dim i As Integer
            For i = LBound(temp) To UBound(temp)
                List1.AddItem temp(i)   '~~~ add each element in the array to the listbox
            Next
        End Sub
    draw a textbox and listbox

    create a text file

    replace the file loocation with ur text file location

    did it work for u ?

  21. #21

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by useruseronline View Post
    Code:
    Option Explicit
    Private Sub Form_Load()
    Open "C:\Downloads\b.txt" For Input As #1
    Dim filesize As Integer
    filesize = LOF(1)
    Text1 = Input(filesize, #1)
    Text1.Visible = False
    Close #1
        
        '~~~ When a button is pressed
       
            Dim temp() As String
            temp = Split(Text1.Text, vbCrLf)    '~~~ Split the lines in the TextBox, separated by a vbCrLf character(newline) and store it in the array
           
            '~~~ Loop through the array
            Dim i As Integer
            For i = LBound(temp) To UBound(temp)
                List1.AddItem temp(i)   '~~~ add each element in the array to the listbox
            Next
        End Sub
    draw a textbox and listbox

    create a text file

    replace the file loocation with ur text file location

    did it work for u ?
    this will pull the contacts and their number from the DB?

  22. #22
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    from textfile

  23. #23

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    i dont understand
    i work with access
    how do i pull it to the text file?
    this is the code that i use to pull the customers from the DB and show it in a listview
    ***************
    Set RS = CN.Execute("SELECT * FROM Customers")

    LsVw.ListItems.Clear
    While Not RS.EOF
    Set Itm = LsVw.ListItems.Add(, , RS!FullName)
    Itm.Bold = True
    Itm.SubItems(1) = RS!Cellular

    RS.MoveNext
    Last edited by salsa31; May 27th, 2012 at 09:11 AM.

  24. #24
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    unzip both files in same folder
    Attached Files Attached Files

  25. #25
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    the code will wok as this file code

  26. #26

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Code:
    what i need basicly is to choose a contact from the db that will be showed in a list 
    and choose to who i ever want to send to him a sms
    or to send to all sms with their numbers ofcurse.
    ****************************************
    this is another form that i send email to
    *********************************
    
    
    
    
    
    Private Sub Check1_Click()
    
    If Check1.Value = vbChecked Then    'select all
    With LsVw
        For i = 1 To .ListItems.Count
            .ListItems(i).Checked = True
            .ListItems(i).Selected = True
            TxtFind.Enabled = False
            
        Next i
    End With
    
    Else                                'desel all
    With LsVw
        For i = 1 To .ListItems.Count
            .ListItems(i).Checked = False
            .ListItems(i).Selected = False
             TxtFind.Enabled = True
             TxtFind.SetFocus
       Next i
      End With
    
    End If
    End Sub
    
    Private Sub Form_Load()
    ListRTL LsVw
    
        Set RS = CN.Execute("SELECT * FROM Customers")
    
            LsVw.ListItems.Clear
            While Not RS.EOF
                Set Itm = LsVw.ListItems.Add(, , RS!FullName)
                Itm.Bold = True
                Itm.SubItems(1) = RS!Email
                Itm.SubItems(2) = RS!Cellular
                
                RS.MoveNext
               Wend
               If LsVw.ListItems.Count = 0 Then
               BttnSend.Enabled = False
               TxtFind.Enabled = False
               Check1.Enabled = False
               Label3.Enabled = False
               Label4.Enabled = False
               LsVw.Enabled = False
               Label1.Enabled = False
               Label2.Enabled = False
               
               
               
               
               
             
               MsgBox "no custs"
               End If
               
               
    End Sub
    
    Private Sub BttnSend_Click()
        Dim SendToAll As String, NoEmails As Boolean
        
        LsVw.SetFocus
        NoEmails = True
        For i = 1 To LsVw.ListItems.Count
            If LsVw.ListItems(i).Checked And Len(Trim$(LsVw.ListItems(i).SubItems(1))) <> 0 Then
                SendToAll = SendToAll & LsVw.ListItems(i).SubItems(1) & "; "
                NoEmails = False
            End If
        Next
        If Not NoEmails Then ShellExecute hwnd, "open", "mailto:" & SendToAll, vbNullString, vbNullString, SW_SHOW
        Unload Me
    End Sub
    
    Private Sub BttnClose_Click()
        Unload Me
    End Sub
    
    Private Sub Timer1_Timer()
    Label1.Caption = LsVw.ListItems.Count
    End Sub
    
    Private Sub TxtFind_Change()
       BttnSend.Enabled = False
       BttnClose.Enabled = False
       Check1.Enabled = False
       Set RS = CN.Execute("SELECT * from Customers WHERE FullName LIKE '%" & RplS(TxtFind.Text) & "%' ORDER BY FullName")
        
        LsVw.ListItems.Clear
        While Not RS.EOF
            Set Itm = LsVw.ListItems.Add(, , RS!FullName)
            
            Itm.Bold = True
            
            Itm.SubItems(1) = RS!Email
            Itm.SubItems(2) = RS!Cellular
            RS.MoveNext
            Check1.Enabled = True
            BttnSend.Enabled = True
            BttnClose.Enabled = True
    
       
        Wend
       If TxtFind.Text <> "" Then
        Check1.Enabled = False
        End If
       
    End Sub
    Last edited by salsa31; Apr 2nd, 2013 at 09:56 AM.

  27. #27
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    is this file solving ur problem to load data in listbox ?

  28. #28

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by useruseronline View Post
    is this file solving ur problem to load data in listbox ?
    no my friend
    this dosnt load the customers that i have in the DB access
    look what i posted earlier mybe it can help

  29. #29
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    snd me few cutomers name

  30. #30

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    this is hairdesign the access file
    you have 2 custs

  31. #31
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    dont send me file snd me names

  32. #32

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    dany macaby phone number: 0544311942
    david cross phone number :0544636473

  33. #33
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    uzip both files in same folder and open project 1 , is it working now ?
    Attached Files Attached Files

  34. #34

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    yes its working but i need thier name and phone numbers

  35. #35
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    name and phone number in listbox ? or just numbers to send msg ?

  36. #36

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    name and phone numbers that i will see which phone number belongs to which name.
    ofcurse this need to be pulled from the database
    Last edited by salsa31; May 27th, 2012 at 09:52 AM.

  37. #37
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    u will have to do it in this way with text file no database

  38. #38

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    can you connect to my pc to see the project?
    maybe this will be more helpful for you to help me?

  39. #39
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    i cant ... plz capture video and upload to youtube i will watch there

  40. #40

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    you have msn?
    if i dont complete this project i will get fired
    this is the only thing that left for me

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width