Solved

Controls on a form not HIDING as they should

Posted on 2016-10-04
3
28 Views
Last Modified: 2016-10-05
I have a simple form plays an audio file to ask a child a question.  While the audio is playing I wanted to hide two images that represent a YES and NO for them to touch their answer.

My problem is when the code is in the same SUB as the audio file player, it won't hide it.  It will UNHIDE them after the audio plays.... and I can use the exact same line by itself from a button and it works.   (Me.Image19.Visible = False)


Private Sub DinoImage_Click()
On Error GoTo ButtonError

Me.Image19.Visible = False
Me.Image20.Visible = False

Dim stID As String
stID = Me.ID.Value
sndPlaySound "C:\HospitalIntake\Audio\Q" & stID & ".wav", SND_ASYNC

Me.Image19.Visible = True
Me.Image20.Visible = True


Exit Sub
ButtonError:
DoCmd.Echo True
DoCmd.SetWarnings True
Dim stErrMSG As String
stErrMSG = MsgBox(Err.Description)
End Sub

Open in new window

ScreenShot.PNG
0
Comment
Question by:TechGuise
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 41828369
Generally, I don't hide buttons, instead I would set the Enabled property to true or false.

Try inserting a line:

DoEvents

or possibly

Me.Repaint

right before the line that plays the sound file.
1
 

Author Comment

by:TechGuise
ID: 41828389
"Me.Repaint" did it thanks.  

I agree, most of the time switching ENABLE to false is good enough.  But they're going to be handing these tablets to pretty small kids.   Thought it better to just hide them while question is playing.  Some of the questions are longer than others, didn't want them trying to answer before entire question has been read.
Thanks again.
0
 

Author Closing Comment

by:TechGuise
ID: 41830305
Thanks!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now