killerflappy
Registered User.
- Local time
- Today, 05:20
- Joined
- Aug 23, 2017
- Messages
- 50
We use a barcode scan-application witch is made in Access with a lot of VBA.
When there is an error with a scanned barcode the DoCmd.Beep will run.
This works excellent whitout any delay.
But nog I want to add an second sound.
This can be done with http://www.cpearson.com/excel/PlaySound.aspx
So I put at the top of the module for barcode scanning:
And then at the place in the code where the sound should play:
This works very slow. The barcodes are scanned in a fast way.
The records are shown very slowely. At the end of scanning the records are half way.
With the DoCmd.Beep the records are shown directly.
I played around with SND_SYN, SND_ASYNC and SND_MEMORY.
But the loading of the wav-files takes to much time.
Is there an other way to play more than one sound (DoCmd.Beep) in a fast way?
When there is an error with a scanned barcode the DoCmd.Beep will run.
This works excellent whitout any delay.
But nog I want to add an second sound.
This can be done with http://www.cpearson.com/excel/PlaySound.aspx
So I put at the top of the module for barcode scanning:
Code:
Private Declare Function sndPlaySound32 _
Lib "winmm.dll" _
Alias "sndPlaySoundA" ( _
ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
And then at the place in the code where the sound should play:
Code:
sndPlaySound32 "C:\Windows\Media\Chord.wav", 0&
This works very slow. The barcodes are scanned in a fast way.
The records are shown very slowely. At the end of scanning the records are half way.
With the DoCmd.Beep the records are shown directly.
I played around with SND_SYN, SND_ASYNC and SND_MEMORY.
But the loading of the wav-files takes to much time.
Is there an other way to play more than one sound (DoCmd.Beep) in a fast way?
Last edited: