Q: VBA Code not Filtering Report Properly To begin with I wasn't sure how to have a report open based off results from a user input and query. So I decided to try write my code for it:
Private Sub menuToReports_Click()

Dim crseFilter As String

'Asks for a course to filter report by
crseFilterQ:
crseFilter = InputBox("Enter a course", "Course Filter")

'If the response is null then returns to asking for filter
If crseFilter = "" Then
    MsgBox ("Please enter one of the following: IB, IAL, AS, GCSE or     None")
GoTo crseFilterQ

'If reponse is none, then shows all students
ElseIf crseFilter = "None" Then
    DoCmd.OpenReport "Students", acViewReport

'Show whatever students are in the course that is specified in the response
Else
    DoCmd.OpenReport "Students", acViewReport, , Course = crseFilter

End If

End Sub

Whenever I run this code it and give it a response other than none, e.g. IB this happens
Ive tried a couple things already but can't seem to get it to work, so I turn to stack overflow. Please help! :p
Any help will be very much appreciated
Thanks in advance

A: The WHERE CONDITION argument is not correct syntax. Since Course is a text type field:
DoCmd.OpenReport "Students", acViewReport, , "Course = '" & crseFilter & "'"
