Beep


Makes a sound using the computer’s built-in speaker.

Syntax

DoCmd.Beep() 

Example

The following code causes the computer to sound a beep whenever the user enters a non-numeric value in the zip code field:

Private Sub txtZipCode_Change()   If Not IsNumeric(Me.txtZipCode) Then   Beep   End If End Sub

Comments

  • The Beep method corresponds to the intrinsic VBA Beep statement.

  • The duration and frequency of the beep are hardware dependent.

  • On systems with sound cards, the beep is defined by the sound assigned to the Default Beep program event in the Control Panel Sounds applet.

  • Although calls to DoCmd.Beep or the Beep statement may be appropriate in some cases (such as particular kinds of data entry errors), they are rarely used in VBA programming.




Access VBA Programming
Microsoft Access VBA Programming for the Absolute Beginner
ISBN: 1598633937
EAN: 2147483647
Year: 2006
Pages: 214
Authors: Michael Vine

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net