Trouble with Select Case code

matthewnsarah07

Registered User.
Local time
Yesterday, 17:53
Joined
Feb 19, 2008
Messages
192
Code:
Private Sub Command19_Click()
Dim strProcedure As String
Select Case Me.ppec
    Case Is = "1"
        strProcedure = "updateppe"
        DoCmd.OpenStoredProcedure strProcedure
    Case Else
        MsgBox "No access granted"
End Select
    
End Sub

I am using the above code to execute a macro when the value of field [ppec] is 1 - the macro is called updateppe - I am just getting an error can't find that object name, how do I execute this macro in this code?

Thanks for your help
 
If it's a macro, it would seem that this is more appropriate:

DoCmd.RunMacro...
 
What a daft mistake - all working now!

Can I ask you other question - is it possible to add more than one Select Case under one event by adding the next one after the End Select?
 
Sure; you can also nest one within another just like If/Then's can be nested.
 

Users who are viewing this thread

Back
Top Bottom