I am having difficulty using the RND function to randomly generate 10 numbers (1-10) to change the form and play a sound. I have used this code, but it does not seem to be working:
Sub Random
Dim Ret
Ret = Int(10 * Rnd) +1)
If Ret=1 Then ChangeForm(Form15)
PlaySound “elephant1.wav”
I have read the handbook, but it doesn’t seem to help my situation.
Does anyone have any suggestions to fix my code?
Thanks!
Greetings @ghenne! I am sincerely sorry I was unclear. My issue is that when I used the code above on a button to generate 10 random numbers (1-10) in order to randomly change the form and play a sound, nothing happened. I believe there is an error in my code, but I am unsure what the error is or how to fix it. I need help from someone advanced to tell me where my error was and how to fix it. Hopefully you understand my issue and can help my situation.
I will also send an image of the chrome debugger as an extra resource for
you.
Also, several of my buttons are not functioning properly. I have used the
code:
Function Image56_onclick()
ChangeForm(Form3)
End Function
But when I click the button, the form does not change. I am unsure whether
this particular issue is connected with the random issue, but reagrdless,
the form does not change.
Greetings!
(I was told the email didn’t go through, so I sent it again just in case)
There are several messages in the Chrome Debugger:
There is an attached image of the Chrome Debugger so you can see all the
messages.
Also, several of my buttons are not functioning properly. I have used the
code:
Function Image56_onclick()
ChangeForm(Form3)
End Function
But when I click the button, the form does not change. I am unsure whether
this particular issue is connected with the random issue, but reagrdless,
the form does not change.