Bit stuck here as to how to pass a parameter to the query:
So far, I've got:
Private Sub combo_DivLevel_Change()
If combo_DivLevel.SelText = "All Divisional Levels" Then
Call Populate_DropDowns("", "")
ElseIf Len(combo_DivLevel.Text) = 5 Then
Dim db As Database 'current database
Dim rs As Recordset 'holds query resultset
Dim qdfParmQry As QueryDef 'the actual query object
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("DivisionalLevelSpecific")
qdfParmQry("DivisionalLevel?") = combo_DivLevel.SelText
Set rs = qdfParmQry.OpenRecordset()
Form.RecordSource = rs
End If
End Sub
I need to change the form's recordsource to the query with a passed parameter and reload the data anytime the combo box is changed...
So far, I've got:
Private Sub combo_DivLevel_Change()
If combo_DivLevel.SelText = "All Divisional Levels" Then
Call Populate_DropDowns("", "")
ElseIf Len(combo_DivLevel.Text) = 5 Then
Dim db As Database 'current database
Dim rs As Recordset 'holds query resultset
Dim qdfParmQry As QueryDef 'the actual query object
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("DivisionalLevelSpecific")
qdfParmQry("DivisionalLevel?") = combo_DivLevel.SelText
Set rs = qdfParmQry.OpenRecordset()
Form.RecordSource = rs
End If
End Sub
I need to change the form's recordsource to the query with a passed parameter and reload the data anytime the combo box is changed...