M
MiHutch via AccessMonster.com
I know this has been addressed several times and I have attempted to look at
those posts and other web sites to come up with a VB code, but no luck.
I would like a Combo Box from my form called Default to sort the data from a
continues sub form called Sort_List. My combo box pulls the names from a
table called Examiner.
When I start the page I get a Compile Error: Syntax Error at line,
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Examiner"
LSQL = LSQL & " where Examiner_Name = '" & cboExaminer & "'"
Form_Sort_List.RecordSource = LSQL <---- This is red in the code page
What am I missing?
Here is the full code for what I am trying to do.
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Examiner"
LSQL = LSQL & " where Examiner_Name = '" & cboExaminer & "'"
Form_Sort_List.RecordSource = LSQL
End Sub
Private Sub cboExaminer_AfterUpdate()
SetFilter
End Sub
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
Private Sub Form_Open(Cancel As Integer)
SetFilter
End Sub
those posts and other web sites to come up with a VB code, but no luck.
I would like a Combo Box from my form called Default to sort the data from a
continues sub form called Sort_List. My combo box pulls the names from a
table called Examiner.
When I start the page I get a Compile Error: Syntax Error at line,
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Examiner"
LSQL = LSQL & " where Examiner_Name = '" & cboExaminer & "'"
Form_Sort_List.RecordSource = LSQL <---- This is red in the code page
What am I missing?
Here is the full code for what I am trying to do.
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Examiner"
LSQL = LSQL & " where Examiner_Name = '" & cboExaminer & "'"
Form_Sort_List.RecordSource = LSQL
End Sub
Private Sub cboExaminer_AfterUpdate()
SetFilter
End Sub
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
Private Sub Form_Open(Cancel As Integer)
SetFilter
End Sub