PLay Audio files in ACCESS (1 Viewer)

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
Sorry - wasn't thinking when I wrote my last reply & just copied what you had written
I've now corrected my last post

CurrentProject.Path is code to return the current folder which isn't relevant in your case

BTW are you sure that .a4m is the correct file type? I use .m4a files but have never heard of .a4m
All the letters were correct, but there was a problem with order. Computers are real
Sorry - wasn't thinking when I wrote my last reply & just copied what you had written
I've now corrected my last post

CurrentProject.Path is code to return the current folder which isn't relevant in your case

BTW are you sure that .a4m is the correct file type? I use .m4a files but have never heard of .a4m

Got all the characters corect, but flunked ordering in high school. Computers are really picky about that sort of thing.
What post # did you correct. Can't seem to find it.
Like your dog.
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
I can play sounds in the example, but can't initiate from a click in textbox. Attached is the example with a form and an textbox. The textbox click event has note for you in it. Hope this is clear enough.

Thanks again for all your help.
 

Attachments

  • PlaySoundTest.zip
    136.1 KB · Views: 71

isladogs

MVP / VIP
Local time
Today, 14:09
Joined
Jan 14, 2017
Messages
18,226
You've just re-posted the file I uploaded in post #10
There's no form or textbox with a message to me....

After 23 posts, perhaps its time you tried some different code. Did you ever look at the countdown timer? See link in post #3
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
You've just re-posted the file I uploaded in post #10
There's no form or textbox with a message to me....

After 23 posts, perhaps its time you tried some different code. Did you ever look at the countdown timer? See link in post #3
Sorry I had problems with zip. Here is example with folder. Jst need to know how to execute the code in click event in textbox. Tried several things to no avail.

Thanks
 

Attachments

  • Dog2.zip
    137 KB · Views: 72

isladogs

MVP / VIP
Local time
Today, 14:09
Joined
Jan 14, 2017
Messages
18,226
There is no evidence that you had tried anything as there was no code on the form
Whilst I'm tempted to ask what you had tried this has dragged on far too long.

I've made one change to the module to make the function public so it can be called from the form.
I've bound the form to a table and added the one line of code. It works.

However, this really isn't the best way of getting this result. You are stuck on using the modified generic code from post #2
Whilst it works, its really not what i would recommend
 

Attachments

  • Playsoundwithform_v2.zip
    155.2 KB · Views: 62

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
There is no evidence that you had tried anything as there was no code on the form
Whilst I'm tempted to ask what you had tried this has dragged on far too long.

I've made one change to the module to make the function public so it can be called from the form.
I've bound the form to a table and added the one line of code. It works.

However, this really isn't the best way of getting this result. You are stuck on using the modified generic code from post #2
Whilst it works, its really not what i would recommend
There is no evidence that you had tried anything as there was no code on the form
Whilst I'm tempted to ask what you had tried this has dragged on far too long.

I've made one change to the module to make the function public so it can be called from the form.
I've bound the form to a table and added the one line of code. It works.

However, this really isn't the best way of getting this result. You are stuck on using the modified generic code from post #2
Whilst it works, its really not what i would recommend
What post would you recommend using? Last question. The example works .This works.
I will leave you alone for now, but thanks for your patience, and your help.
Greatly appreciated.
 

isladogs

MVP / VIP
Local time
Today, 14:09
Joined
Jan 14, 2017
Messages
18,226
I can only assume you didn't even look at the Countdown Timer example that I have mentioned several times in this over-long thread
The relevant point (mentioned on that web page) is that it contains code to play a selected sound chosen from a combo box.

The idea was that you could adapt that code for use in your own apps.
Clearly that would appear to have been over-optimistic on my side
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
You should use code to open the file asynchronously so that you can also pause or stop it before it is finished
Have a look at the code in my example app
I downloaded the timer from your site, the ACCDB, unzipped it but I can't get the DB to open in design mode. it's loked somehow. Can't enable content. Looked at properties of file and there entry for allow.
You should use code to open the file asynchronously so that you can also pause or stop it before it is finished
Have a look at the code in my example app
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
I just downloaded the Zipped version of the time, but cant seem to open the ACCDB in order to see the code. Went back a read the site info to see if i missed something, but it says that the code should be visible in the zipped version. I checked the properties and there was nothing in there to open/allow the db to work. Am I missing something? Using office 365 with latest updates, and latest windows 10 .
 

isladogs

MVP / VIP
Local time
Today, 14:09
Joined
Jan 14, 2017
Messages
18,226
As with all files downloaded from the internet, the file must first be unblocked before any code can run.
If you don't know what that means, read my article:

Then click the Enable Content button in Access so code can run . . . or better still place it in a trusted location
The form then opens with the Access application window hidden (with the form 'floating' on the desktop)
The right click shortcut menu has been disabled in the property sheet

To view the form design & code, re-open using the shift bypass (hold down the shift key as you open it)

BTW - why do you include duplicated quotes in almost all your posts?
 
Last edited:

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
As with all files downloaded from the internet, the file must first be unblocked before any code can run.
If you don't know what that means, read my article:

Then click the Enable Content button in Access so code can run . . . or better still place it in a trusted location
The form then opens with the Access application window hidden (with the form 'floating' on the desktop)
The right click shortcut menu has been disabled in the property sheet

To view the form design & code, re-open using the shift bypass (hold down the shift key as you open it)

BTW - why do you include duplicated quotes in almost all your posts?
There was now MOTW in properties, but the shift open worked. I duplicated the message because I was interrupted in the middle of things, and didn't remember if I sent it or not.
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
Dear sir, I got it to work in my app, but using the original code, not the code in the Timer. The problem is, as you mentioned., it opens the Groove Music app and covers the screen. (I have 4 monitors, so it's no problem for me.). You said that the TImer code allows for pause and restart, which will be needed. I take full responsibility for oversized number of posts between us. I am older, and have never patient person anyway, and sometimes gloss over the fine print. ("The large print giveth, and the small print taketh away") So I spent all of yesterday rereading the posts, and experimenting.
Just wanted to say thanks for your help.
 

isladogs

MVP / VIP
Local time
Today, 14:09
Joined
Jan 14, 2017
Messages
18,226
You are of course welcome to use whatever you want.
Glad you have a solution that suits your needs even if it was very convoluted getting there
 

jpl458

Well-known member
Local time
Today, 06:09
Joined
Mar 30, 2012
Messages
1,038
It was caused by my overlooking details, like who actually sent a post, or, what code was I actually working on, you know, minor stuff. It reminds me of this story; " An engineer, a scientist and a mathematician are on a train together. The engineer looks out the window and says 'There are brown cows in Michigan'. The scientist joins in, 'There are some cows that are brown in Michigan'. The mathematician states 'There some cows in Michigan that are brown on one side'.

Thanks again
 

Users who are viewing this thread

Top Bottom