-
[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
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
try doing it this way ...
-
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?
-
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
-
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
http://i47.tinypic.com/2a8qcut.jpg
-
Re: sending sms with listview and checkbox in listview
plz upload ur and attach ur form .. i shall see the list method
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
plz upload ur and attach ur form .. i shall see the list method
to upload only the sms form you meen
-
Re: sending sms with listview and checkbox in listview
ya tha form which u explained
-
Re: sending sms with listview and checkbox in listview
this is the form of the sms
-
Re: sending sms with listview and checkbox in listview
this is the access file that i store the custs
hair.mdb
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
this is the form of the sms
this is not the form u showed in picture .... there is no listbox
-
Re: sending sms with listview and checkbox in listview
this is not a list box i use a listview
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
this is not a list box i use a listview
use list box it will be easy
-
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
-
Re: sending sms with listview and checkbox in listview
can you show me an example plz?
-
Re: sending sms with listview and checkbox in listview
-
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?
-
Re: sending sms with listview and checkbox in listview
i know to do it with data from textfile will it be ok ?
-
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
-
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 ?
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
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?
-
Re: sending sms with listview and checkbox in listview
-
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
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
unzip both files in same folder
-
Re: sending sms with listview and checkbox in listview
the code will wok as this file code
-
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
-
Re: sending sms with listview and checkbox in listview
is this file solving ur problem to load data in listbox ?
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
useruseronline
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
-
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
this is hairdesign the access file
you have 2 custs
-
Re: sending sms with listview and checkbox in listview
dont send me file snd me names
-
Re: sending sms with listview and checkbox in listview
dany macaby phone number: 0544311942
david cross phone number :0544636473
-
1 Attachment(s)
Re: sending sms with listview and checkbox in listview
uzip both files in same folder and open project 1 , is it working now ?
-
Re: sending sms with listview and checkbox in listview
yes its working but i need thier name and phone numbers
-
Re: sending sms with listview and checkbox in listview
name and phone number in listbox ? or just numbers to send msg ?
-
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
-
Re: sending sms with listview and checkbox in listview
u will have to do it in this way with text file no database
-
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?
-
Re: sending sms with listview and checkbox in listview
i cant ... plz capture video and upload to youtube i will watch there
-
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