Hi
I am using the following code, and basically what I want it to do is this:
User selects a Business Unit from drop down list, they then click on a button and it creates a report based on the the business unit selected from the drop down list.
It converts the reoprt to RTF and then fires up a new email, but it picks the first change champion form the table and not the query from the drop down list, any ideas
Dim stDocName As String
Dim stMailList As String
Dim stCCMailList As String
Dim stHeader As String
Dim stMessageBody As String
Dim stSROD As Date
stDocName = "Rpt Deployment Feedback"
stMailList = "steve duncan"
While TempStore <> Me.[Business Unit Name]
DoCmd.GoToRecord , , acNext
Wend
stCCMailList = Me.[Change Champion]
stSROD = Me![Scheduled Roll out date]
stHeader = "XP Phase2 Feedback Form: " & Trim(Me![Business Unit Name]) & " : " & stSROD
stMessageBody = "Please see attached XP Phase 2 Feedback Form, could you complete and return. " & Chr(10)
stMessageBody = stMessageBody & stSROD & " in Business Unit: " & Trim(Me![Business Unit Name]) & "." & Chr(10) & Chr(10)
DoCmd.SendObject acSendReport, stDocName, acFormatRTF, stMailList, stCCMailList, "", stHeader, stMessageBody, False
5 2913 PEB 1,418
Expert 1GB
Hi,
Where is this code placed? As a bouton ina Form maybe?
It gats the information of your combo and from other fields in your form with the current record information!
PLS check your Record Source of your Report that you send!
Maybe it's your table NOT?
The code is based on a button on the form and I have doubled checked the record source, it definatley comes from a query and not the table.
NeoPa 32,556
Expert Mod 16PB
I don't see anywhere in your code that specifies that the report should filter its output.
If this filter is defined in one of the properties of the report itself, then that is relevant information and we need to see it to be able to help.
PEB 1,418
Expert 1GB
Is your query referenced to your Combo box?
ie in the criteria of your query written somewhere:
=Forms!Form1!Combo
?
The code is based on a button on the form and I have doubled checked the record source, it definatley comes from a query and not the table.
While TempStore <> Me.[Business Unit Name]
DoCmd.GoToRecord , , acNext
Wend
Looking at your code above. Is TempStore the aforementioned combobox
If it is..
When you manually go though the records using the navigation buttons is it holding its value.
Based on this code it seems as if the TempStore is an unbound combo box and on the same form as the records.
Please correct me if I'm wrong. If this is the case there is a better way of doing it.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Wenin |
last post by:
I have four total tables.
Table One (Documents)- List of Documents. Each record has two fields
related to this issue. First field (Document_ID) is the ID of the
document, second field is the...
|
by: William Wisnieski |
last post by:
Hello Again,
I'm really stuck on this one.....so I'm going to try a different approach to
this problem.
I have a query by form that returns a record set in a datasheet. The user
double...
|
by: mathilda |
last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than
SELECT all other factors being equal. I disagree. We are linking an
Access front end to a SQL Server back end and normally are...
|
by: Grant McLean |
last post by:
Hi
First a simple question ...
I have a table "access_log" that has foreign keys "app_id" and
"app_user_id" that reference the "application_type" and "app_user"
tables. When I insert into...
|
by: Jimmy |
last post by:
thanks to everyone that helped, unfortunately the code samples people gave me don't work. here is what i have so far:
<%
Dim oConn, oRS, randNum
Randomize()
randNum = (CInt(1000 * Rnd) + 1) *...
|
by: bpforte |
last post by:
Hello,
I need help with building query, basically I need to select all records
from one table that don't exists in second table with status 1, but
they can exists in second table with status 0, to...
|
by: MP |
last post by:
vb6,ado,mdb,win2k
i pass the sql string to the .Execute method on the open connection to
Table_Name(const) db table
fwiw
(the connection opened via class wrapper:)
msConnString = "Data Source="...
|
by: Matthew Wells |
last post by:
I have a listbox set to simple multi select. For this example, users only
select one item at a time. I have command buttons on the form for First,
Previous, Next, Last, New (record). The form...
|
by: Deano |
last post by:
I have a little search routine going whereby the user types in some text and
clicks a button on the main form.
I then see if that text exists in a record on the subform. I get a match,
grab the...
|
by: Sunray |
last post by:
I have a form called the sales form and i have 2 sets of listboxes
So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |