<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2>Bob - just wondering.....do the users
have a preference for the input box approach? Another idea is to have a form
(bound to a report table) where the user gets to plug in the content to those
fields and then click a preview button to produce the report with that data. I
use that approach quite a lot - it can be very frustrating entering data into
input boxes - one false move and you have to start over. With the form approach
they can keep editing until they get it right and re-use common
text.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Kath</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=bob@renaissancesiding.com href="mailto:bob@renaissancesiding.com">Bob
Gajewski</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=accessd@databaseadvisors.com
href="mailto:'accessd@databaseadvisors.com'">'accessd@databaseadvisors.com'</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 20, 2003 1:55 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [AccessD] Print letter from
InputBox data (contains long code at bottom)</DIV>
<DIV><BR></DIV>Dear Group<BR><BR>I have a generic letter report that uses
InputBoxes to allow custom <BR>on-the-fly paragraph data entry.<BR><BR>The
sequence asks the user for paragraph 1. If anything was input, it asks <BR>for
paragraph 2, then 3, then 4. Finally, it asks for the signator's name <BR>and
title. The report os then displayed in preview mode. ALL OF THIS WORKS
<BR>PERFECTLY. I can see the entire letter with all data, as entered. Also,
<BR>when the preview is closed, the user is asked whether the letter printed
<BR>properly, and if they respond yes, it automatically writes a record to the
<BR>comments child table to record the event. THIS ALSO WORKS
PERFECTLY.<BR><BR>My problem is when I try to actually print the letter (using
File, Print or <BR>clicking on the Print button), the program somehow starts
over and prompts <BR>the user for paragraph one again (et cetera). I sure
don't want users <BR>having to type their letters twice!<BR><BR>I'm missing
something probably very obvious, and any guidance would be <BR>greatly
appreciated!<BR><BR>Thanks,<BR>Bob
Gajewski<BR><BR>**********************************************<BR>Option
Compare Database<BR>Option Explicit<BR>Public gvarRecordFound As
Boolean<BR>Public strInput1 As String<BR>Public strInput2 As String<BR>Public
strInput3 As String<BR>Public strInput4 As String<BR>Public strInputS As
String<BR>Public strInputT As
String<BR>------------------------------------------------------<BR>Private
Sub Report_NoData(Cancel As Integer)<BR>Dim Msg, Response<BR>Msg = "This
report is not available; no records exist."<BR>Response = MsgBox(Msg,
vbInformation)<BR>DoCmd.CancelEvent<BR>End
Sub<BR>------------------------------------------------------<BR>Private Sub
Detail_Format(Cancel As Integer, FormatCount As
Integer)<BR><BR>gvarRecordFound = True<BR><BR>Dim MyPos<BR>
MyPos = InStr(1, [txtJobHomeownerName], ",")<BR><BR>If MyPos > 0
Then<BR> Me.txtLetterName = Mid([txtJobHomeownerName], MyPos
+ 1, 35) & " " & <BR>Left([txtJobHomeownerName], MyPos -
1)<BR> Me.txtSalutation = "Dear " &
Mid([txtJobHomeownerName], MyPos + 1, 35) <BR>& " " &
Left([txtJobHomeownerName], MyPos - 1) & ":"<BR>Else<BR>
Me.txtLetterName = [txtJobHomeownerName]<BR>
Me.txtSalutation = "Dear " & [txtJobHomeownerName] & ":"<BR>End
If<BR><BR>If Left([txtLetterName], 1) = " " Then<BR>
[txtLetterName] = Mid([txtLetterName], 2, 35)<BR>End If<BR><BR>If
Left([txtSalutation], 1) = " " Then<BR> [txtSalutation] =
Mid([txtSalutation], 2, 41)<BR>End If<BR><BR>
Me.txtLetterAddress = [txtJobAddress]<BR>
Me.txtLetterLocation = [txtJobMunicipalityName] & ", " &
<BR>[txtJobStateCode] & " " & [txtJobZipCode]<BR>
Me.txtClaimNumber = "'" & [txtJobCompanyReference] & "'"<BR><BR>'Allow
user to enter text for paragraphs 1-4<BR> Dim strMsg1 As
String<BR> strMsg1 = "Please enter
the text for paragraph 1:"<BR>
strInput1 = InputBox(Prompt:=strMsg1, Title:="Paragraph
1")<BR> If Not (IsNull(strInput1) Or
strInput1 = "")
Then<BR>
Me.txtParagraph1 =
strInput1<BR>
Dim strMsg2 As
String<BR>
strMsg2 = "Please enter the text for paragraph
2:"<BR>
strInput2 = InputBox(Prompt:=strMsg2, Title:="Paragraph
2")<BR>
If Not (IsNull(strInput2) Or strInput2 = "")
Then<BR>
Me.txtParagraph2 =
strInput2<BR>
Dim strMsg3 As
String<BR>
strMsg3 = "Please enter the text for paragraph
3:"<BR>
strInput3 = InputBox(Prompt:=strMsg3, <BR>Title:="Paragraph
3")<BR>
If Not (IsNull(strInput3) Or strInput3 = "")
Then<BR>
Me.txtParagraph3 =
strInput3<BR>
Dim strMsg4 As
String<BR>
strMsg4 = "Please enter the text for <BR>paragraph
4:"<BR>
strInput4 = InputBox(Prompt:=strMsg4, <BR>Title:="Paragraph
4")<BR>
If Not (IsNull(strInput4) Or strInput4 = <BR>"")
Then<BR>
Me.txtParagraph4 =
strInput4<BR>
End
If<BR>
End
If<BR>
End
If<BR><BR>
'Allow user to enter text for signator and
title<BR>
Dim strMsgS As
String<BR>
strMsgS = "Please enter the signator's
name:"<BR>
strInputS = InputBox(Prompt:=strMsgS,
<BR>Title:="Signator")<BR>
If Not (IsNull(strInputS) Or strInputS = "")
Then<BR>
Me.txtSignator =
strInputS<BR>
Dim strMsgT As
String<BR>
strMsgT = "Please enter the signator's
title:"<BR>
strInputT = InputBox(Prompt:=strMsgT,
<BR>Title:="Title")<BR>
If Not (IsNull(strInputT) Or strInputT = "")
<BR>Then<BR>
Me.txtSignatorTitle =
strInputT<BR>
End
If<BR>
Else<BR>
Me.txtSignator = "Renaissance
Siding"<BR>
End If<BR>
Else<BR>
MsgBox "There was no text entered for Paragraph
1."<BR>
Cancel =
True<BR>
gvarRecordFound = False<BR> End
If<BR><BR>End
Sub<BR>------------------------------------------------------<BR>Private Sub
Report_Close()<BR>If gvarRecordFound = False Then<BR> Exit
Sub<BR>End If<BR>Dim db As Database, rs As Recordset<BR>Dim Response<BR>Dim
strMsgPrint As String<BR> strMsgPrint = "Did the letter
print properly?"<BR>If vbNo = MsgBox(strMsgPrint, vbYesNo + vbQuestion, "Print
Letter <BR>Verification") Then<BR> Response =
acDataErrDisplay<BR>Else<BR> 'Add letter subject to
comments<BR> Dim strInput As String, strMsg As
String<BR> strMsg = "What was the
subject of this letter?"<BR>
strInput = InputBox(Prompt:=strMsg,
Title:="Subject")<BR> If
IsNull(strInput) Or strInput = ""
Then<BR>
strInput = "NOT SPECIFIED"<BR> End
If<BR> Set db = CurrentDb<BR> Set rs =
db.OpenRecordset("tblJobComments", dbOpenDynaset)<BR> On
Error Resume Next<BR>
rs.AddNew<BR> Dim strComment As
String<BR>
strComment = "HOMEOWNER LETTER PRINTED (SUBJECT: " & <BR>UCase(strInput)
& ")."<BR> rs!lngJobID =
lngJobID<BR> rs!txtJobComment =
strComment<BR> rs!dteJobCommentNow =
Now()<BR> rs!cboJobCommentPrivate =
False<BR> rs.Update<BR> If Err
Then<BR> MsgBox "An error occurred,
and the comments were not updated." & <BR>vbCrLf & "Remember to add a
comment to the database" & vbCrLf & "record <BR>indicating that the
letter was sent today."<BR> Response
= acDataErrContinue<BR>
Else<BR> Response =
acDataErrAdded<BR> End If<BR>
rs.Close<BR>End If<BR>End
Sub<BR><BR>_______________________________________________<BR>AccessD mailing
list<BR><A
href="mailto:AccessD@databaseadvisors.com">AccessD@databaseadvisors.com</A><BR><A
href="http://databaseadvisors.com/mailman/listinfo/accessd">http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>Website:
<A
href="http://www.databaseadvisors.com">http://www.databaseadvisors.com</A><BR></BLOCKQUOTE></BODY></HTML>