By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Report help

P: 4
Hello all,

I am no programer but I have been given a task to create an access program that will take in info from our customer service requests and then generate a report which will be sent off via email. I have the whole program done however i need to know how can you view only the last report. I have a contact number that generates a number for each entered request. so to give a clear idea this is how the program works enter contacts name address phone...etc choose which catalog they request. then i have a button at the bottom that when pressed prompts the email editor with the snapshot view of the reports all i need is to send the report i just entered. If there is a program code that would be helpful. again i am not a programer so if you can provide as much detail that would be great. Thanks!
Nov 10 '06 #1
Share this Question
Share on Google+
7 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Sorry not enough information to help. Some questions and suggestions though.

I have a contact number that generates a number for each entered request.
Where is this number stored and how does it relate to each report?

all i need is to send the report i just entered
How is the report being generated. What is the records source of the report. You say the report is in sanpshot view but it is generating for all records. It sounds like you need to change the open report code to only show specific record

DoCmd.OpenReport "ReportName", , , "RequestNumber" = Me.RequestNumber

In this case RequestNumber would be a field in the reports record source and on the report (can be invisible) and it would also have to be a textbox on the form.
Nov 12 '06 #2

P: 4
I have as the contact number it is a auto number that is the key. Yes all i am trying to do is when the report is made i just want it to show the last record entered and that is it. Right now when i double click the report icon i have all the records in there in decending order acording to the auto generate number but i want to only view the last record so that when sending it in an email the receiver does not have too have all the records just the last one that is ment for that person.
Nov 13 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
I have as the contact number it is a auto number that is the key. Yes all i am trying to do is when the report is made i just want it to show the last record entered and that is it. Right now when i double click the report icon i have all the records in there in decending order acording to the auto generate number but i want to only view the last record so that when sending it in an email the receiver does not have too have all the records just the last one that is ment for that person.
You need to find some way to specify the record. See my suggestion in previous post.
Nov 13 '06 #4

P: 4
Would the "RequestNumber" be my Contact Number that i have in the report and in the form. this is an auto field. I assume i would enter this code into the On open in an event procedure.
Nov 13 '06 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
Would the "RequestNumber" be my Contact Number that i have in the report and in the form. this is an auto field.
That should work

I assume i would enter this code into the On open in an event procedure.
No it's behind a command button usually on the form designed to print the report.
Nov 13 '06 #6

P: 4
Ok i tried that but maybe i am doing something wrong here is what i have for the code:
Private Sub Save_Click()
On Error GoTo Err_Save_Click

Dim stDocName As String


stDocName = "Danly IEM"
DoCmd.RunMacro "Macro1"
DoCmd.OpenReport "Danly IEM", , , "Contact_Number" = Me.Contact_Number
DoCmd.SendObject acSendReport, "Danly IEM", acFormatSNP, "doberg@danly.com", , , "Literature Request", "See the attached file for literature request", True



Exit_Save_Click:
Exit Sub

Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click

End Sub
Nov 13 '06 #7

MMcCarthy
Expert Mod 10K+
P: 14,534
OK Change to

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Save_Click()
  3. On Error GoTo Err_Save_Click
  4. Dim stDocName As String
  5.  
  6. stDocName = "Danly IEM"
  7. DoCmd.RunMacro "Macro1"
  8. DoCmd.OpenReport "Danly IEM", , , "[Contact_Number]=" & Me.Contact_Number
  9. DoCmd.SendObject acSendReport, "Danly IEM", acFormatSNP, "doberg@danly.com", , , "Literature Request", "See the attached file for literature request", True
  10.  
  11. Exit_Save_Click:
  12. Exit Sub
  13.  
  14. Err_Save_Click:
  15. MsgBox Err.Description
  16. Resume Exit_Save_Click
  17.  
  18. End Sub
  19.  
Nov 13 '06 #8

Post your reply

Sign in to post your reply or Sign up for a free account.