What am I doing wrong here?

D

dhstein

OK - I coded a subroutine from the book that looks like this:
Option Compare Database
Option Explicit
Sub BeepWarning()
Dim xBeeps As Integer
Dim nBeeps As Integer
nBeeps = 5
For xBeeps = 1 To nBeeps
Beep
Next xBeeps
End Sub



Then I selected the event to run and got this:

Private Sub btnBeep_Click()
BeepWarning()
End Sub

When I click the button I get:
Compile Error Syntax Error message

Any help would be appreciated
 
S

Stefan Hoffmann

hi,
Private Sub btnBeep_Click()
BeepWarning()
End Sub

When I click the button I get:
Compile Error Syntax Error message
You don't need the brackets. Remove them.

mfG
--> stefan <--
 
T

Tom van Stiphout

You probably meant "parentheses".

Private Sub btnBeep_Click()
BeepWarning
End Sub

Also, when in code view, you can select menu option Debug > Compile
which will point out exactly which line of code is the problem.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top