Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2013
    Posts
    9

    Exclamation Unanswered: How to play a sound from a subform?

    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!

  2. #2
    Join Date
    Nov 2011
    Posts
    413

    How to play a sound from a subform

    Here is an example. Of course edit path for wav file.

    HTH
    Attached Files Attached Files

  3. #3
    Join Date
    Jul 2013
    Posts
    9
    Thanks for the fast reply Burrina, 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!

  4. #4
    Join Date
    Jul 2013
    Posts
    9
    Here's the database, sorry!
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2011
    Posts
    413

    How to play a sound from a subform

    Here is the revised version. I put the code under Pallet No. See if that is what you wanted. I also used your sound file. This was tested.

    HTH
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2013
    Posts
    9
    Thanks for the reply Burrina, we are making progress, if you can see the subform within the form, you will see the fields i need calculated, specifically, i need the sound when the value in "cases picked" is bigger than the value in "cases required"
    Everytime i scan a box, the subform adds that box to the "cases picked" field, but i want MS access to let me know whenever i try to scan more boxes than enough, thanks again!

  7. #7
    Join Date
    Nov 2011
    Posts
    413

    How to play a sound from a subform

    I am not completely sure this is what you want since some of your code is in spanish.If not, you should be able to adapt it to what you need. Hope this is what you want, if not, adapt it!

    HTH
    Attached Files Attached Files
    Last edited by Burrina; 09-17-13 at 15:55. Reason: Code Edit.

  8. #8
    Join Date
    Jul 2013
    Posts
    9
    lol, i'm sorry, but i've been here since the last 3 hours and just can't get it working, the code should be in the subform or in the main form?
    Thanks again!

  9. #9
    Join Date
    Nov 2011
    Posts
    413
    This is very confusing to me.Either it is on the Main form or the subform.I think I will bow out of this one. I believe I have given you enough code to make it work. Good Luck With Your Project.

  10. #10
    Join Date
    Jul 2013
    Posts
    9
    Ok, Burrina, you helped me a lot today, i will give some thought to this code tonight, have a good one!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •