How to play a sound from a subform? (1 Viewer)

jorge.miranda

New member
Local time
Today, 16:42
Joined
Sep 15, 2013
Messages
4
Hi, i need assistance with a problem i just can't discramble:
I have to tables:
Table 1 contains "cases picked"
Table 2 contains "cases required"

i have a query with info populated from those 2 tables:
field "results" shows the results of this calculation:
"cases required"-"cases picked"="results"
In this query I have a conditional format stating: If true, displays text "ok" and the field will be green, if false, displays text "alert" and the field will be red.

Then I have this query in a subform (a form within another form), now:

I would like to have a code or a formula for this query, where it would play a sound if (and only in this case) the value of "cases picked" is bigger than the value in "cases required"

This is how it works, you open the main form, start using a barcode scanner to scan cases, everytime you scan each case, the subform is refreshed and adds cases, and shows results, and shows how many cases you are missing or how many cases you are over, but this is only in the screen, i would like to have a sound in this subform, so in case you pick more cases than required, a loud sound is played as an alert, i still can't figure out where to put the solution, if as a formula in the query, or a code in the subform, please, i've been reading all over the cloud and can't find the answer, i will appreciate any help, thanks in advance!
 

mrojas

Registered User.
Local time
Today, 16:42
Joined
Sep 8, 2012
Messages
22
I would put code on the OnCurrent form event. This code, using a simple If statement, would validate the result at the cases picked.
If (Cases Picked>Cases Required) then
Call the PlaySound routine
End If
Unfortunately, this website does not allow me to post links. I have one that shows you have to write code that would play a sound file.

You can email me, Rojas at Astound dot net.
 

jorge.miranda

New member
Local time
Today, 16:42
Joined
Sep 15, 2013
Messages
4
Thanks for the fast reply Mrojas, and for your effort, your file could help me, but i don't know where to put it, i'm uploading a portion of my database (please don't laugh) so you can have a better understanding of what i need.
All you have to do is:
Open verification form
Select "order number"
Select "pallet number"
Start using the barcode scanner on each box

And what i need is, for example:
The number of cases required is 7, and when you scan box number 8, database plays a loud alert



If you can help me with the proper code, i will really appreciate it, thanks!
 

Attachments

  • Database1.zip
    661.9 KB · Views: 383

Users who are viewing this thread

Top Bottom