What am I doing wrong here?

What am I doing wrong here?

Post by ZGhzdGVpb » Fri, 28 Nov 2008 04:36:05


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
 
 
 

What am I doing wrong here?

Post by Stefan Hof » Fri, 28 Nov 2008 04:53:34

hi,


You don't need the brackets. Remove them.

mfG
--> stefan <--

 
 
 

What am I doing wrong here?

Post by Tom van St » Fri, 28 Nov 2008 13:49:55

On Wed, 26 Nov 2008 20:53:34 +0100, Stefan Hoffmann < XXXX@XXXXX.COM >


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
 
 
 

What am I doing wrong here?

Post by Stefan Hof » Fri, 28 Nov 2008 20:04:42

hi Tom,


Indeed, I did. Thanks.


mfG
--> stefan <--