Solved

Controls on a form not HIDING as they should

Posted on 2016-10-04
3
55 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

739 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