Sending E-mail To Filtered Result
Jan 6, 2005
Happy New Year to ALL!
I am trying to e-mail from a form that displays filtered result, but having trouble. Could someone please guide me?
I am using DoCmd.SendObject (a routine that I found in a newsgroup). This routine works fine when I am sending it to all the recipients, but not to filtered recipients. The form shows filtered result, but I am not being able to use the command to only send to filtered recipients. Instead, when I press the button to e-mail, it populates the cc: field with all the e-mail addresses rather than the filtered addresses.
Any help would be greatly appreciated. Thank you.
Here is the code:
Private Sub cmdGenerateList_Click()
'Create Email list from the appropriate query and open Outlook with those addresses in the cc: field
Dim db As Database, rs As Recordset, sql As String, emailTo As String, txtEmailList As String
On Error GoTo Err_cmdGenerateList_Click
Set db = CurrentDb()
emailTo = ""
sql = "select EmailName from qInd_info "
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!EmailName) Then
'build up email addresses separated by a semicolon
emailTo = emailTo & rs!EmailName & "; "
End If
rs.MoveNext
Loop
'Remove the last semicolon
If Right(emailTo, 2) = "; " Then
emailTo = Left(emailTo, Len(emailTo) - 2)
End If
' Me.txtEmailList = emailTo
'Create the message with the recipients in the BCC: field
' DoCmd.SendObject acSendNoObject, , , , , emailTo
DoCmd.SendObject acSendNoObject, , , , emailTo
Exit_cmdGenerateList_Click:
Exit Sub
Err_cmdGenerateList_Click:
Select Case Err.Number
Case 2501
Resume Next
Case Else
MsgBox Err.Description
Resume Exit_cmdGenerateList_Click
End Select
End Sub
View Replies
ADVERTISEMENT
Jan 2, 2015
In the following code, I debug a problem with the CurrentDb.OpenRecordset
Code:
' ---
' ENVOYER UN MAIL DEPUIS ACCESS
' ---
' Entree : strEmail <- Adresse e-mail du destinataire
' strObj <- Objet du courrier
' strMsg <- Corps du message
[Code] ....
View 7 Replies
View Related
Dec 29, 2011
This is the first time I am trying to do mail merge from access.
Actually I have a query and I have designed the letter template in Ms word.
Now I want to filter the query based on the data passed from the access form and merge the filtered data in Ms words mail merge.
View 1 Replies
View Related
Oct 26, 2006
I am using Docmd.sendobject to print a report to Outlook so that I can e-mail the report. The method used to work. Outlook would open, I'd elect my recipients and could click the send button to e-mail the report. Now the send button is disabled once the report shows as an attachment in Outlook. I have to ctrl-alt-del to break the process and outlook gives me an error message regarding the ole object. Is there anyway to fix this problem or a possible root cause. Thank you
:(
View 1 Replies
View Related
Jan 19, 2006
I've got information stored per row with the name of the person which data-entried the information.
If a user wants feedback from that user on that specific row i would like to make it able to send a mail to the data-entrier. The data-entrier name should be clicked in the row and that specific row should be attached in the mail.
I can store e-mail addresses of my data-entriers in the database, how do i achieve to send the mail address and specific row to outlook when a user clicks it?
View 2 Replies
View Related
Jul 16, 2014
I am in project to send members a birth day greeting with image.
Now I have designed report containing JPEG image. but i am not able to send report to mail as Mail body using MS outlook.
View 1 Replies
View Related
Jun 21, 2006
I have created a query of 382 records. After filtering I now have a result set of 32 records, which I want to save as another query.
When I select Save As and rename, I get my original 382 record query with a new name.
How do I save the 32 record result set?
View 1 Replies
View Related
Jun 23, 2006
Hi, this is probably a very easy question for you “Access-gods” out there.
I’ve made a database (MS Access 2000) with all my clients. I collect a lot of contact info, including e-mail.
I want to make a function which opens a new mail window (Outlook 2003) and automatically puts in the e-mail from my form (In the send-to field of outlook).
Is this possible? And how?
(BTW: I’m a newbie with VBA)
View 2 Replies
View Related
Apr 26, 2013
I have a ms access table with two fields...tablename is ..."Addresses"..
Field1:= Employee_mail_id
Field2:= Leave_balance
What I need to do is that,I need to send individual mail (in Bulk) two each employee intimating their leave balances.
Is it possible to do it in vb .I want it to assign the codes in a button.
Below iss the code.
Dim r As Recordset
Dim email As String
Set r = CurrentDb.OpenRecordset("select * from Addresses")
Do While Not r.EOF
email = email & r(2) & ";"
r.MoveNext
Loop
r.Close
DoCmd.SendObject acSendNoObject, Null, Null, email, Null, Null, "Test subject", "Message body of the test letter", False, Null
View 2 Replies
View Related
Mar 5, 2014
I am working with Access 2010, on vista. What I have is a query made up of two tables, one product the other inventory. (see below) query.jpg
In the product table i have a field called "minimum reorder level". In the inventory table i have two fields one called "number in stock" and "number on order". What i want to happen is "number on order" to be filtered by the result, if the "number in stock", is less than "minimum reorder level", if it is, have the result placed in the "number on order" field. EG. if the "number in stock" = 2 and the "minimum reorder level" = 5 then 3 would be placed in the field "number on order" and only the second record from the query would be visible (see below) Query result.jpg The result of this would mean that the field "number on order" would be populated with the result and the and query would also use this to filter the record.
View 1 Replies
View Related
Aug 18, 2013
I want to add a number to my results within a query depending on the month and how many results. For example I have 10 results in my query 3 from January, 5 from March and the rest from April. The 3 from January would be 1,2,3. The five in March would be 1,2,3,4,5 and so on. Is it possible to do?
I'm using access 2003.
View 4 Replies
View Related
Oct 12, 2013
I there is no result in query, I need the default result zero in my form field. I only use query wizard to create queries.
View 5 Replies
View Related
May 29, 2007
All:
I'd like to make the result of my text box flash (in my form) if the its value is less than 30..For example. If A - B < 30, then the result whatever it is as long as it is less than 30..Is this possible in Access? thanks in advance.. :
View 1 Replies
View Related
Aug 2, 2005
I would like to know how I can put filter fields on a DAP that when you press a button will then filter a table. Also, does anyone know of any good references on working with DAP, becasue from what it seams like, there isn't any technical information out there.
View 1 Replies
View Related
Sep 27, 2004
Hi everyone, I am new to writing queries in access and I have got stuck with this one.
I have 2 tables containing similar data from 2 different paradigms.
The main columns I am interested in are not unique - labelled ID and Delta Ex (a score). The same ID values can occur more than once in the same table, so I am interested in calculating the average Delta Ex score for each ID value in each table.
I then want to ask what ID values occur in both table 1 and table 2 and then calculate the average score of each common ID values across both tables. i.e. ID 1 score = avg(table1.delta ex, table 2.delta ex).
I then want to rank the top 50 scores.
So far I have the following to find common ID values, with a score above a threshold set by the input string threshold. These are ordered with in descending score value.
SELECT [MODEL 1].[ID], [MODEL 1].[Delta Ex]
FROM [MODEL 1], [MODEL 2]
WHERE ((([MODEL 1].[Delta Ex])>[threshold]) And (([MODEL 2].[Delta Ex])>[threshold]) And (([MODEL 1].[Accession])=[model 2].[accession]))
ORDER BY [MODEL 1].[Delta Expression] DESC;
With a second query I can select the top 50 scores:
SELECT TOP 50 [query 1].ID, [query].[Delta Ex]
FROM [query 1]
ORDER BY [query 1].[Delta Ex] DESC;
However, I can't for the life of me work out how to obtain an avg score for each ID value.
Any help would be very much appreciated.
J
View 2 Replies
View Related
Jan 25, 2006
Hey all, I have been trying to filter my report However It doesnt seem to be working the way I would like it to. I have the ability to filter on my form, so I can search Wood* and then there will be 27 records displayed so I can view each one speratly. however now I would like to have it on a report. I would like to then click the report button, and view those 27 records on my report as the layout that I have provied I can see multiple on a sheet. Any ideas?
View 4 Replies
View Related
Feb 9, 2012
I have two tables, say customers and purchase orders. I am trying to write query that returns a list of customers based on a wild card purchase order search.(FYI, the query is being used in a VB.NET application)
Code:
SELECT Customers.WarehouseID AS Customers_WarehouseID, Customers.Name, PurchaseOrders.PurchaseOrder, PurchaseOrders.WarehouseID AS OBRs_WarehouseID
FROM Customers INNER JOIN OBRs ON Customers.[WarehouseID] = OBRs.[WarehouseID]
WHERE (((OBRs.OBR) Like '" & strPOFilter & "*'));
This query almost works how I'd like it to, except in cases where a single customer has multiple purchase orders that begin the same way. So, for example, if customer "mike" has purchase orders "00554" and "00553", if you search for "00", mike will be returned twice. How can I modify the query to only return the customer once?Is it possible, or should I filter out repeated offenders in my code?
View 2 Replies
View Related
Jun 8, 2005
I have a form that contains a pretty large list of items and several columns and the list can be sorted by each of these columns. When a user double-clicks on a particular item, another form pops up that lets the user view/modify the item. The problem I'm having is that I still want to be able to use the navigation buttons in that second form, but right now its just saying 1 of 1 (Filtered).
The way I'm applying the sorting is by updating the Rowsource field of the list with an "Order By" statement
Any help would be appreciated
Adam
View 2 Replies
View Related
Sep 15, 2005
i've created a form base on a query, and other users will work on it (mainly filter). then i created a report base on the same query...
what i want is a "print" button on the form which will print the report, not all records, but only the filtered records after user applied their filters...
since users will apply different filters each time, it's quite impossible to make all different filters as query...
any idea?
View 12 Replies
View Related
Jan 27, 2006
Hello all,
I have looked through the forum, found some things, but not sure if they help with what I need specifically. I tried looking at the microsoft website, but can't really follow some of the things they have there.
On clicking a form (called Manager), I would like a list of some fields from a query (called queryMgr) to pop up, so that I can put in the criteria as I would if I just used the query, and then submit or run, and the form gives the filtered results. I don't want users to open the query and put in their criteria, I just want them to go to the form directly
When I click the form, I want the following to pop up at the same time so I can fill in the criteria:
Date
Vendor Number
Invoice Number
Check Received (this is a Yes or No field)
and then when I click submit or enter, the form gives me say 5 records that match this criteria.
Thanks a lot!!!
View 1 Replies
View Related
Aug 8, 2006
I'm new to Access and am trying to work out the best way to achieve the following.
I need a way for users to be able to filter the data which is displayed by forms or output in reports. For example, suppose that a user wants a list of all customers in either of two specific towns with a specific date of birth.
Obviously this could be achieved using a query and setting the criteria of the towns column to be:
"Anytown 1" or "Anytown 2"
and setting the criteria of the Date of Birth column to be the specific date required, e.g.
"08/08/2006".
However, so far everything about my database has been very user friendly with forms for data entry and presentation, so I don't really want to force my users to start creating their own queries.
The alternative I'm thinking of is as follows. Provide a query to pull together the required information (from various tables) but without any specific criteria. Then create a form with a field for each of the columns in the query, and allow the user to type their critieria into these. Then, place If statements as the criteria of the query to check if there is anything typed into each box on the form and, where there is, set it as the critieria for the query, then run the query.
With the above in mind, I have two questions.
1) Is there a better, more "standard" way to achieve a system of allowing users to create customised filtered data without requiring them to write queries?
2) In some cases, e.g. like with my specification of a town above, it would be good if the user could select the town they want to filter for from a drop-down combo box, rather than typing it in and risking entering details incorrectly. However, this would obviously allow them to select only one town, and not two as was required in my example. Is there an equivalent to a combo box which would allow multiple selections?
Thanks in advance if anyone can help me - and please remember that I am new to Access so whilst I want the best possible solution, I need a plain English explanation!
Gary
View 4 Replies
View Related
Oct 9, 2006
Ok access noob here and a first post as well...I have to filter a table that has children and teachers.I made a form with a combo box of teacher names then filteredon the teacher name.in the subform I have to create a matrix of the children thatare assigned to that teacher.it would be something like thisteacher date child name start endthe teacher and child name are in tblmainthe date start and end values have to be in tbldata1so the beginning they want to choose a teacher and a dateso I shifted and put the teacher in a combo box and tied it to nothingbut the subformso combo box teacher and field datelinks to subform are teacher;datecombo box(teacher name)==> Ms. Eve text box(date)==> 01/01/06but they want a filtered list on teacher so the subform would have to beteacher date child name start endMs. Eve 01/01/06 mary lamb Ms. Eve 01/01/06 billy bullMs. Eve 01/01/06 bob jonesthen they could put in start and end for each childI don't see how I can get the child names filtered thru a query (thisI can do) BUT then to be able to edit the fields and put this datainto a new table.IS there a way to do this?a big help for any ideas or pointers as I am lost on this
View 3 Replies
View Related
Dec 5, 2006
Help !! - Can anyone help. I have had a quick look through the previous threads and can't seem to find anything that may help me. Has anyone got any ideas.
I have a table which has many columns, one of these columns is called actions. On the design of the table, the action column is a Text Datatype and on the lookup tab the row source is a typed in list of actions.
A form has been created from this one table. A drop down box has been created which looks at the action column and so drops down to give us our typed in list of actions.
Users will select the current action from the drop down list.
What I actually want to do is depending on what the current selected action is, that the drop down box only shows a subset / filtered list of actions.
I know how this is designed is not the tidiest/slickest way of doing things, But unfortunately, I have inherited this from someone else who has been running the database this way for over 6 years !!
View 1 Replies
View Related
Apr 22, 2008
I have a text column that has some Letter in it, the format is #A-##A where A = Alpha, the last Alpha is also not required. What I want to do is get a list of all the first A's, so like i have 11P-23A, 22G-45B, 33K-67C and I want to get A,G,K is this possible?
View 3 Replies
View Related
Jan 25, 2005
Hi
I want a filtered pop up form to accept new records.
The archive posting that I found suggested that I insert
[MyForm]![LinkedField] as the default value of the linked field.
Any suggestions gratefully accepted.
Steven811
View 5 Replies
View Related
Nov 1, 2005
Ok heres the problem, i seem to have a little bit of a mind block at the moment so help would be greratly appreciated.
Basically there are two tables involved, tblBikes (which contains all information on the bikes) and tblHires (which contains all the information about hired bikes) these are linked with a one to many relationship as each bike can be hired out many times.
I have a button on a form containing bike information which opens the hires form filtered by the bike ID of the record selected in the first form. When I add a record to the hires form i need the bikeID to be automatically input into the field.
View 14 Replies
View Related