Solved

Controls on a form not HIDING as they should

Posted on 2016-10-04
3
49 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

820 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