Compile Error for 'myresponse'

Maestro

Registered User.
Local time
Today, 10:53
Joined
Jun 16, 2001
Messages
21
When I click an "Exit" button on my form I want the database to prompt the user to confirm before exiting. The code I'm using below for some reason works fine at home on my Win '98 machine but not at work on my NT machine ("Compile Error - Can't find project or library"). It doesn't seem to recognise 'myresponse'. As I need the database to work in as many environments as possible, is there any alternative code I could use?

Dim MyRepsonse As Variant

Let myresponse = MsgBox("Are you sure you want to exit?", vbYesNo, "Database Name")
If myresponse = vbYes Then

Dim stDocName As String

stDocName = "Close"
DoCmd.RunMacro stDocName

End If
 
You've spelt myresponse/myrespsonse differently in the code to the declaration - leave in option explicit at the top and any errors like that will be flagged for u. Also a correct entry will change the capitalization of the var to its declaration

Anke
 
Oops! well spotted. If only everything were that simple to sort out...
 

Users who are viewing this thread

Back
Top Bottom