Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject object problem

Status
Not open for further replies.

l0knezmonstir

Technical User
Jul 18, 2002
19
US
I am using sendobject to email different queries. There are over 100+ different queries that will be needed so I would rather not create and save each query in the database. I can change the queries with loops and string manipulation, but I'm having trouble sending out that actual query. Is there any way around this?

-Marty Loftus
mloftus@ybi.info
 
How about creating a table with two fields, QryName and QrySQL. Load each query's name and its sql into the table and e-mail the table.
 
Im actually trying to send out the results of the query in excel format. The problems is that I need to send each of ours reps a list of their schools. so the main query needs to be split up a bunch of times. or am i not understanding your suggestion.
-marty
 
You understood me, I misunderstood you.

Do you have one query and over a hundred recipients, each receiveing his own set of recoreds? If so, set up a make table query. then loop through a list of recipients, create a temporary table for the first, then send it to him with the send object command. read the next recipient, change the criteria, run the query and send it. keep looping unitl rs.EOF
 
I think thats what i need to do. each rep basically gets the same query but filtered for their name. how do you set up temporary tables with a make table query?
-marty
 
the query that you are using for picking off the data related to each recipient would be opened in the design mode and click on the query type button (to the left of the red exclamation mark) and choose Make table. It will ask for a table name. give it a table name and save. I assume that any automatic process for applying criteria has been worked out already and that this can be matched to a name and e-mail address. then the process would be

select first criteria and e-mail address
top of loop
supply criteria to query
set warnings off
run query
set warnings on
sendobject
movenext criteria and emailaddress
loop

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top