Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Current Record

Status
Not open for further replies.

Melody24

Technical User
Apr 20, 2000
1
US
I'm trying to email a report of only the current record from my form, but each time all the records print out or only a blank report prints out. Any ideas? Here's how it looks...<br><br>Private Sub Mail_AttachA_Click()<br>On Error GoTo Err_Mail_AttachA_Click<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim strToWhom&nbsp;&nbsp;As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim strMsgBody As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim intSeeOutlook As Integer<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim strRptName As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim strWhere&nbsp;&nbsp;As String<br><br>&nbsp;&nbsp;&nbsp;&nbsp;intSeeOutlook = MsgBox(&quot;Preview email message?&quot;, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vbYesNo, &quot;Attachment A&quot; & Me.Caption)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;If intSeeOutlook = vbNo Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strToWhom = InputBox(&quot;Enter Buyer's email address.&quot;, &quot;Attachment A&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intSeeOutlook = False<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br><br>&nbsp;&nbsp;&nbsp;&nbsp;strRptName = &quot;Attachment A&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;strWhere = &quot;[POCN#]=&quot; & Me![POCN#]<br><br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.SendObject acSendReport, strRptName, acFormatRTF, strToWhom, , , _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;POCN Attachment A&quot; & Me.Caption, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Please review the following changes.&quot;, strWhere, intSeeOutlook<br><br>Exit_Mail_AttachA_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br><br>Err_Mail_AttachA_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;MsgBox Err.Description<br>&nbsp;&nbsp;&nbsp;&nbsp;Resume Exit_Mail_AttachA_Click<br><br>End Sub<br>
 
Make a query that looks at just your record and make your reports source look at that query.<br>So the Criteria of the query is a unique filed on your form.<br><br>Your query needs to have all of the fields which show up on your report. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top