I have a combobox limiting student slots to a certain number on a form 1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;...
It works great but...
The problem is that after closing the form and opening it again, all the records show and not those of the last filter. Maybe the answer is to somehow permanently change the referenced query?
Does anyone know how to fix this so the last filter result is secured?
Code:
Private Sub cboName_AfterUpdate()
On Error GoTo Err_cboName_AfterUpdate
Dim strSQL As String
strSQL = "SELECT * FROM qryAssignmentJunction WHERE StudentID <= " & Me.cboName & ";"
Me.RecordSource = strSQL
Me.Requery
Exit_cboName_AfterUpdate:
Exit Sub
Err_cboName_AfterUpdate:
MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
Resume Exit_cboName_AfterUpdate
End Sub
The problem is that after closing the form and opening it again, all the records show and not those of the last filter. Maybe the answer is to somehow permanently change the referenced query?
Does anyone know how to fix this so the last filter result is secured?
Last edited: