Is it possible to email a FORM in snapshot format?

CEH said:
Heres a thought...... Create a blank report. Put it in design view, drag and drop your form onto the report. Now you have a report with a form embedded in it. When you preview the report, you preview the open form. I have played a little with this..... works so far for me... You might have to add some code to filter what form records show..... BUT...... it is now a report.... So the Docmd.sendobject should work now with a snapshot format.
:D Thanks CEH I have taken this path, only there're two issues.
1. I am not able to change the properties on my report programmatically, the way i've done with the forms.

2. How can i not open the "report" but change the properties without opening it on my screen. I only want to use it for emailing.

can anyone look at my format report section in my code please? :)
Code:
Private Sub cmdPendingJobs_Click()
On Error GoTo Err_cmdPendingJobs_Click

    Dim stDocName As String, stDocName2 as String
    Dim stLinkCriteria As String

    stDocName = "frmSearchResults"
    stDocName2 = "rptSearchResults"
    
    'where status is not "completed"
    stCriteria = "[jobId] like " & "'*'"
    stCriteria = stCriteria & " and [status] Not Like 'c*' "
    DoCmd.OpenForm stDocName, , , stCriteria
    Form_frmSearchResults!lblInfo.Caption = "These are the pending jobs (i.e. Jobs Not Started or In Progress)"
    Form_frmSearchResults.Caption = "Jobs that are not completed"
    Form_frmSearchResults!lblInfo.ForeColor = 21760
    Form_frmSearchResults!lblInfo.BackColor = 13893544
    Form_frmSearchResults.FormHeader.BackColor = 13893544
    Form_frmSearchResults.Detail.BackColor = 13893544

'format report
    DoCmd.OpenReport stDocName2, , , stCriteria
    Report_rptSearchResults!lblInfo.Caption = "These are the pending jobs (i.e. Jobs Not Started or In Progress)"
    Report_rptSearchResults.Caption = "Jobs that are not completed"
    Report_rptSearchResults!lblInfo.ForeColor = 21760
    Report_rptSearchResults!lblInfo.BackColor = 13893544
    Report_rptSearchResults.FormHeader.BackColor = 13893544
    Report_rptSearchResults.Detail.BackColor = 13893544

Exit_cmdPendingJobs_Click:
    Exit Sub

Err_cmdPendingJobs_Click:
    MsgBox Err.Description
    Resume Exit_cmdPendingJobs_Click
End Sub
 
I seem to recall that you can't modify report when it is open in preview. Also, if you open report without any argument, you'd be actually printing.

Therefore, you need to open the report in design view
Code:
Docmd.OpenReport "Name", , , acDesign
(don't remmy how many commas there are)

then you can modify the properties, save and close then you can open it in preview. (I have no clue on how to get it in snapshot and attach to email programmically though).

HTH.
 
Banana said:
I seem to recall that you can't modify report when it is open in preview. Also, if you open report without any argument, you'd be actually printing.

Therefore, you need to open the report in design view
Code:
Docmd.OpenReport "Name", , , acDesign
(don't remmy how many commas there are)

then you can modify the properties, save and close then you can open it in preview. (I have no clue on how to get it in snapshot and attach to email programmically though).

HTH.
Thanks Banana, as always ;)
I'll go try this.

Once i get the formatting of the report in the right format and saved--all automatically, i know how to attach it to emails programatically.

Let's see...
 

Users who are viewing this thread

Back
Top Bottom