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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject - how do you save formats Yes/No 1

Status
Not open for further replies.

BillieBurgess

Technical User
Jul 2, 2002
36
0
0
US
Hello,
I am using a form to send out report (queries) to multiple accounts limiting the report to records with their account #. The report is in excel format and comes from a query. Everything works find, except my Yes/No fields show up as True/False. My Boss wants Yes/No. The Table format is Yes/No, The Query Format is Yes/No. However, when you open the attachement is says True/False.
The code is as follows:

Dim stDocName1 As String
Dim strEmailAddress As String
Dim strSubject As String
Dim strMessageText As String
Dim strMessageHeader As String
Dim strMessageGreeting As String
Dim strMessageTextLine1 As String
Dim strMessageTextLine2 As String
Dim strMessageTextLineClosing As String
Dim strMessageTextError As String
Dim strRecordCount As String
Dim strEmailAddress1 As String
Dim strEmailAddress2 As String

strEmailAddress1 = "Chip.Yodzis@dowelectronics.com;Rusty.moore2@dowelectronics.com;Ed.Kowalczyk@dowelectronics.com;Phillip.Partain@dowelectronics.com"

With Me.RecordsetClone
While Not .EOF
stDocName = "NoticeDailyAgreementReportDwnloadGroupByDealerAndReport"
strEmailAddress =
strSubject = Format(Now(), "yymmdd") & " DLR " & [DealerAccount] _
& " " & [ReportName] & " Dish Daily Agreement File"
strMessageHeader = "Dealer OE: " & [RETAILEROENO] & Chr(13) & Chr(10) & "Dealer Account: " & [DealerAccount] & Chr(13) & Chr(10) _
& "Current Email Address: " & Nz([Email], "N/A") & Chr(13) & Chr(10) & "Fax Number: " & Nz([FaxNumber], "N/A") & Chr(13) & Chr(10) & "Phone Number: " & [Phone] & Chr(13) & Chr(10) & Chr(13) & Chr(10)
strMessageGreeting = "Dear Dow Retailer"
strMessageTextLine1 = "In an effort to help you monitor your open claim issues, Dow will be forwarding data every business day (in the form of a excel attachment) on agreements that had activity during the previous twenty-four hour period. While this is not a summary of all open claims on your account, this information will allow you to see the last known status of any claim on your account that was reviewed, modified, or closed within the Echo Agreement Reporting system for the previous day ."
strMessageTextError = Nz(Err.Description, " ")
strMessageClosing = Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Dow Electronics"
strRecordCount = [CountOfAGREEMENTID]
strMessageText = strMessageHeader & Chr(13) & Chr(10) & strMessageGreeting & Chr(13) & Chr(10) & strMessageTextLine1 _
& strMessageClosing & Chr(13) & Chr(10) & Chr(13) & Chr(10) & strMessageTextError & Chr(13) & Chr(10) & "Record Count: " & strRecordCount
DoCmd.SendObject acSendQuery, stDocName, acFormatXLS, strEmailAddress1, , , strSubject, strMessageText, True
.MoveNext
Me.Bookmark = .Bookmark
Wend
End With
 
Yes/No or True/False are display formats of 0/-1, Excel just does not have the Yes/No option.

Convert it to a string in the query before putting it out to Excel, eg:

Switch([YesNoField]=-1,"Yes",[YesNoField]=0,"No")



TomCologne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top