Listbox Filter on Subform

  • Thread starter Thread starter Stewart Saathoff
  • Start date Start date
S

Stewart Saathoff

Hello.

I have a listbox that is doing some odd things. I want it to filter the
results of a subform whenever I click an option in the listbox. It will
only do this when I select the record that is numbered "1"

Does anyone have any idea why? Below you will find the list of code for the
click event of the listbox.


Private Sub lstCourses_Click()
Dim strSQL As String

strSQL = "SELECT * FROM Courses WHERE"
strSQL = strSQL & " CourseID=" & Me!lstCourses
Me!Courses.Form.RecordSource = strSQL

End Sub

Again, when I click on the record that has a CourseID of "1", the subform
populates correctly. Otherwise, nothing...

When I have the properties of the subform open, I can see that the
recordsource for the subform is changing properly, but the results are not
displayed in the controls...

Any help would be appreciated.

Stewart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top