T
Tokyo Alex
Dear all,
I'm experiencing an issue that I think may be a bug.
I have a form with a command button, btnNewProcess. In the Code behind the
Form, I have the following routine:
Private Sub btnNewProcess_Click()
On Error GoTo Err_btnNewProcess_Click
DoCmd.SetWarnings False
Dim stDocName As String
stDocName = "qdmQuoteHeadersWeWant"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qdmQuoteDataExtract"
DoCmd.OpenQuery stDocName, acNormal, acEdit
MsgBox "Extract Completed", vbInformation, "Success!"
Exit_btnNewProcess_Click:
DoCmd.SetWarnings True
Exit Sub
Err_btnNewProcess_Click:
DoCmd.SetWarnings True
MsgBox Err.Description
Resume Exit_btnNewProcess_Click
End Sub
When I originally wrote the code, I did NOT have Option Explicit in the
module. This worked fine. Absolutely no problems at all. However, when I
added Option Explicit (after being reminded how crucial it is) to the module,
the routine will no longer run. At all. Instead, I get the following error
message:
"The expression On Click you entered as the event property setting produced
the following error: Variable not defined."
This same error occurs for all other event procedures in the module (most of
which are very similar to the sample above) also. I have been through the
code and am sure I don't have any undeclared variables anywhere. If I
comment out the Option Explicit it goes back to working fine.
I'm using Access 2007 on an Access 2003 format .mdb file. OS is Windows XP
Pro.
Is this a bug? If so is there a work around? Or am I dong something
monumentally stupid somewhere?
Any comments or advice greatly appreciated.
Thanks,
Alex.
I'm experiencing an issue that I think may be a bug.
I have a form with a command button, btnNewProcess. In the Code behind the
Form, I have the following routine:
Private Sub btnNewProcess_Click()
On Error GoTo Err_btnNewProcess_Click
DoCmd.SetWarnings False
Dim stDocName As String
stDocName = "qdmQuoteHeadersWeWant"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qdmQuoteDataExtract"
DoCmd.OpenQuery stDocName, acNormal, acEdit
MsgBox "Extract Completed", vbInformation, "Success!"
Exit_btnNewProcess_Click:
DoCmd.SetWarnings True
Exit Sub
Err_btnNewProcess_Click:
DoCmd.SetWarnings True
MsgBox Err.Description
Resume Exit_btnNewProcess_Click
End Sub
When I originally wrote the code, I did NOT have Option Explicit in the
module. This worked fine. Absolutely no problems at all. However, when I
added Option Explicit (after being reminded how crucial it is) to the module,
the routine will no longer run. At all. Instead, I get the following error
message:
"The expression On Click you entered as the event property setting produced
the following error: Variable not defined."
This same error occurs for all other event procedures in the module (most of
which are very similar to the sample above) also. I have been through the
code and am sure I don't have any undeclared variables anywhere. If I
comment out the Option Explicit it goes back to working fine.
I'm using Access 2007 on an Access 2003 format .mdb file. OS is Windows XP
Pro.
Is this a bug? If so is there a work around? Or am I dong something
monumentally stupid somewhere?
Any comments or advice greatly appreciated.
Thanks,
Alex.