Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How can I email a snapshot or text of the current record in an open form?

Posted on 2007-07-31
7
Medium Priority
?
342 Views
Last Modified: 2013-11-28
Database in MS Access 2000.

This should be easy, but it is urgent.  How can I email a snapshot or text of the current record in an open form?

I have tried the following two methods, but there is no "where" option to specify the record.  

DoCmd.SendObject acForm, "QM_Nonconforming_f", "HTML(*.html)", "person@doit.com", "", "", "QC Rejecion Notice", "QC has rejected the following item.", True

and

DoCmd.SendObject acReport, "QM_Nonconforming_r", "SnapshotFormat(*.snp)", "person@doit.com", "", "", "& Me.[Part Number] & "" has been rejected.""", "QC has rejected the attached item.", False, ""
       
    'run printing module
    Mod_Main.Print_Report Me.[TotalLoadsTagged]
   
    'open form for new record
    DoCmd.GoToRecord , , acNewRec
0
Comment
Question by:cjkurtz
  • 3
  • 3
7 Comments
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 400 total points
ID: 19601015
Try opening a report from your form with a WHERE condition specifying the current record before sending it:

Docmd.Openreport "MyReport", acviewpreview,,"[ID] = " & Me.ID
DoCmd.SendObject acReport, .....
0
 
LVL 13

Expert Comment

by:wiswalld
ID: 19601028
DoCmd.SendObject acSendReport, "casereport", acFormatRTF, "jogndoe@yahoo.com", , , "QC has rejected the following item.", 0, False

this is form rtf but change for your needs.
0
 
LVL 13

Accepted Solution

by:
wiswalld earned 1600 total points
ID: 19601062
sorry, totally misread the question. You need to open the report as mbizup said using a where condition or use open arguments.

On open:

Filter = "[lastname]= Forms!personsearch.lastnamesearch"
        FilterOn = True
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cjkurtz
ID: 19610983
I am not having success with either solution.

I tried the filter, but I am not sure where it would go.  II think if I didn't save the form first, it just gave me a blank form & I had other troubles.  Thanks for your help.

Private Sub cmdPrint_Click()
     
    'email notice - doesn't work, sends all records
    DoCmd.OpenReport "QM_Nonconforming_r", , , "[NonconformingNumber] = _
    " & Forms!QM_Nonconforming_f![NonconformingNumber] ' (would not work with me.NonconformingNumber)

    DoCmd.SendObject acReport, "QM_Nonconforming_r", "SnapshotFormat_   (*.snp)", "cppp@czzz.com", "", "", "Rejection Notice", "QC has rejected the attached item.", False, ""
   
    'save record in form in order for module to print the current form - doesn't work with code running above
    'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
   
    'run printing module - doesn't work right without the line above
    Mod_Main.Print_Report Me.[TotalLoadsTagged]
   
    'Close Form so that we can open again with a new blank form
    DoCmd.Close
   
    'open form again in order to get a new blank form
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "QM_Nonconforming_f"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
   
   
End Sub
0
 
LVL 13

Expert Comment

by:wiswalld
ID: 19611200
If a subform then

Forms!QM_Nonconforming_f.form.[NonconformingNumber]
0
 

Author Comment

by:cjkurtz
ID: 19614507
Not a subform.

The filter worked when II put it in the OnOpen event in the report properties.

Thanks for the help
0
 

Author Comment

by:cjkurtz
ID: 19614523
This may have worked with more work, but all the ways I tried didn't work for me.  Thanks.

"mbizup:Try opening a report from your form with a WHERE condition specifying the current record before sending it:

Docmd.Openreport "MyReport", acviewpreview,,"[ID] = " & Me.ID
DoCmd.SendObject acReport, ....."
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question