It seems like it works for the ComputerLookUp combo box now, and that's great. Your code looks a lot cleaner than mine.
Your ComputerLookUp Query is:
Code:
Private Sub OUFilter_AfterUpdate()
'Call subroutine to set filter based on selected OU
SetOUFilter
If Not IsNull(Me.OUFilter) Then
Me.[HIPAA datasheet subform].Form.RecordSource = "SELECT * FROM HIPAA WHERE OU = '" & OUFilter.Column(1) & "';"
End If
Me.ComputerLookUp.Requery
End Sub
Yet, you notice I still need to call the SetOUFilter subroutine. That’s where I’m going to have a difference, I think.
Your SetOUFilter is:
Code:
Sub SetOUFilter()
Dim SubFormSQL As String
SubFormSQL = "SELECT * FROM HIPAA"
If IsNull(Me.OUFilter) Then
' Give them all of the computers
Else
SubFormSQL = SubFormSQL & " WHERE OU = '" & OUFilter.Column(1) & "'"
End If
Me.RecordSource = SubFormSQL
Me.ComputerLookUp.Requery
End Sub
It seems I'm having trouble posting my code into this reply. I'll try to put it in the next one.