Very simple sub procedure won't run

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I am comfortable with Excel VBA, but have a problem running my first sub
procedure in Access. I am following a tutorial book, the sub is very simple,
but when I position the cursor inside the sub and click on Run I get a prompt
for macro name as if the VBE does not recognise the sub as capable of being
run ...

Public Sub OpenClientForm()
' Open the Client form
DoCmd.OpenForm "Clients"
Debug.Print 'The form is open'
End Sub

Is this an installation error, or a security problem or something?
I am running MS-Access 2002.

Any suggestions gratefully received!
 
Sorted - the procedure was written in the code section of a form and not in a
module ... once that had been fixed, it worked!
 
Back
Top