Avatar of TechGuise
TechGuise
Flag for United States of America

asked on 

Controls on a form not HIDING as they should

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
Microsoft AccessVBA

Avatar of undefined
Last Comment
TechGuise

8/22/2022 - Mon