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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!