Filter Command Button

S

Sol

The wizard created the following code to filter a form
based on one linking field. I would like it to filter the
form based on (2) linked fields. The linked field below is
[Course Number], and I also need it filter by
[Semester/Year]. What do I need to add (and where) so it
will link both fields. Both fields are already in both
forms.

Thank you.

Sol


Private Sub View_Class_Click()
On Error GoTo Err_View_Class_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Classes Form"

stLinkCriteria = "[CourseNumber]=" & "'" & Me![Course
Number] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_View_Class_Click:
Exit Sub

Err_View_Class_Click:
MsgBox Err.Description
Resume Exit_View_Class_Click

End Sub
 

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

Top