[AccessD] Puzzler for this week - DoCmd.OutputTo changing Report Name to Upper Case, but not all of the time

Brad Marks BradM at blackforestltd.com
Wed May 5 13:24:54 CDT 2010


All,

After seeing the incredible energy, time, and expertise invested in a
recent Puzzler, I thought that
it would be fun to share this one.

I recently discovered this bug (feature?).  I have implemented a little
work-around (duct taped it).  Now this has turned into more of a
curiosity question.

Has anyone else ever seen something like this with VBA code?

I copied the code directly from the program into this e-mail.

Brad   

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'
' VBA Puzzler
' DoCmd.OutputTo changing Report Name to Upper Case, but not all of the
time
'
' This is the strangest thing I have seen for awhile.
'
' Report002 (lower case) is plugged into str_Report_Name
'
' The first Msgbox displays  Report002 (Lower Case)
' The second Msgbox displays REPORT002 (Upper Case)
'
' It appears that the DoCmd.OutputTo command is changing Report002 to
REPORT002
'
' Now the really fun part...  If I plug in Report001 or Report003 they
are
' NOT changed to Upper Case

'
' Here is how str_Report_Name is defined at the beginning of the program

' Global str_Report_Name As String




str_Report_Name = "Report002"


MsgBox "Before OutputTo   str_Report_Name = " & str_Report_Name


DoCmd.OutputTo acOutputReport, _
str_Report_Name, _
"HTML(*.html)", _
str_Generated_Report_File_Name, _
False, _
"", _
0, _
acExportQualityPrint


MsgBox "After OutputTo   str_Report_Name = " & str_Report_Name


'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the AccessD mailing list