May 8 2012, 06:24 AM
I have some code that is causing Access to crash and not sure what the issue is. I cannnot see any isuues with the code. Here is the code:
Private Sub Command35_Click()
On Error GoTo Err_Command35_Click
Dim stDocName As String
stDocName = "02 OPEN ABG'S ITEMS"
DoCmd.OutputTo acReport, stDocName
When Access crashs it ask me if I want to send a report back to Microsoft. Does anyone have an idea why this code is causing it to crash?
May 8 2012, 06:40 AM
I think I have found the problem. I think that the OutputTo command does not like the fact that there is a apostrophe in the name of the report. Once I took that out of the name the report exports fine. Strange....
May 8 2012, 09:23 AM
An ' (apostrophe) has meaning to Access, particularly when it is inside " (double quotes).
May 8 2012, 10:54 AM
Thanks but a funny thing, there was another report with no ' in the name and it was crashing also. I re-typed the line with the name in it and it also started working (strange indeed). Microsoft never ceases to amaze me.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here