MsLady
Traumatized by Access
- Local time
- Today, 11:56
- Joined
- Jun 14, 2004
- Messages
- 438
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.

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