-
I am mad realy mad
it is almost 4 days thath I am trying to find solution to the problem.
Please somebody help me because I am losing my mind.
maybe in this forum there is a solution but I have not found it.
I have created a form (using wizard) from the table (tblosn) with the names of people who live in different cities all of them also had a email, phone number and so on.
while I am using a form the people can easily be filtered by city using right click on my mouse and select "equal amsterdam" or other city.
I want to make a button on this form which must open outlook and put in Bcc all filtered emails from this form. if I chose for example all the people which name start with "A" the button must open outlook and put in Bcc all the e mail adres of those people.
after thath I will write a message in the body of open outlook
For now I have a "solution" that allows me to open outlook and put all emails in Bcc from table not form by pressing the button irrelevant to the filter I made but I do not need this..
pleas, pleas, pleas...
-
this is how my cod looks like now and I do non need it but it do what I have previously written
Private Sub Command69_Click()
Dim strEMail As String
Dim oOutlook As Object
Dim oMail As Object
Dim strAddr As String
Dim MyDB As DAO.Database
Dim rstEMail As DAO.Recordset
Set oOutlook = CreateObject("Outlook.Application")
Set oMail = oOutlook.CreateItem(0)
'Retrieve all E-Mail Addressess in tblEMailAddress
Set MyDB = CurrentDb
Set rstEMail = MyDB.OpenRecordset("Select * From tblosnova", dbOpenSnapshot, dbOpenForwardOnly)
With rstEMail
Do While Not .EOF
'Build the Recipients String
strEMail = strEMail & ![EMail] & ";"
.MoveNext
Loop
End With
'--------------------------------------------------
With oMail
.BCC = Left$(strEMail, Len(strEMail) - 1) 'Remove Trailing ;
.Body = "sadržaj skupnog maila"
.Subject = "IRTA"
.Display
End With
Set oMail = Nothing
Set oOutlook = Nothing
rstEMail.Close
Set rstEMail = Nothing
End Sub
-
Instead of creating your own Recordset, use the RecordsetClone of the Form which will be filtered as you wish.
-
OK, but how ?
I have no idea about makeing this change in my cod. please can you write this for me?
-
Try replacing this line:
Set rstEMail = MyDB.OpenRecordset("Select * From tblosnova", dbOpenSnapshot, dbOpenForwardOnly)
With:
Set rstEMail = Me.RecordsetClone
If this helped, please click the star at the bottom left of this posting and add to my reputation
. Many thanks.
Bob Fitzpatrick
-
I love you guys... This is a solution to my problem.
everything works perfectly.
-
Excellent! Thanks for posting back with your success.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules