Question
vba code shows every message box when its only suppose to show one message box at a time when the user selects their preference. can
vba code shows every message box when its only suppose to show one message box at a time when the user selects their preference. can I have help fixing this. please leave a copy code or comments with how to fix it
Private Sub btnOk_Click()
Dim Recommend As String Dim Popularity As String Dim msg As String
If OptProfessor = True And optMost = True Then Recommend = "By Professor" Popularity = "Most Popular Song" End If
MsgBox " Professors recommend YellowBrick Cinema as the most popular song by 60%."
If OptProfessor = True And OptLeast = True Then Recommend = "By Professor" Popularity = "Least Popular" End If
MsgBox " Professors recommend JaBig as the least popoluar song by 85%."
If OptStudent = True And optMost = True Then Recommend = "By Student" Popularity = "Most Popular Song" End If
MsgBox " Students recommend Instrumental Music as the most popular song by 65%."
If OptStudent = True And OptLeast = True Then Recommend = "By Student" Popularity = "Least Popular" End If
MsgBox " Students recommend JaBig as the least popular song by 75%."
If OptAnonymous = True And optMost = True Then Recommend = "By Anonymous" Popularity = "Most Popular Song" End If
MsgBox " Anonymous recommend YellowBrick Cinema as the most popular song by 90%."
If OptAnonymous = True And OptLeast = True Then Recommend = "By Anonymous" Popularity = "Least Popular" End If
MsgBox " Anonymous recommend JaBig as the least popular song by 10%."
ireply = MsgBox(msg, vbQuestion + vbOKCancel) Select Case ireply Case vbCancel MsgBox "Sorry, you dont want to listen." Exit Sub End Select
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started