Hello all,
I am new to posting on the forum but have been lurking for a little while now. I am trying to resurrect an old database but need some help.
Using 2 comboboxes, I want users to select the document type (Form, policy, manual etc) and Department . I have called these comboboxes: cbotypefilter and cbodeptfilter. The field names are Type and Dept
Ideally, I want users to select from each combo box and have my multiple item form show all the selected type files we have pertaining to that department. (ex, if user selects policy for accouting- the filter will bring up all policies related to accounting)
I am not great with database, its been almost 10 years since I took a university class, so I need some help with the code. This is what my thought process is:
If Me.cbotypefilter <> "" Then
If Me.cbodeptfilter <> "" Then
Me.Filter = Some code that states to filter based on Type from cbotypefilter and Dept from cbodeptfilter
Me.FilterOn = True
Else (filter based on just type alone- is this code right?)
Me.Filter = "Type = """ & Me.cbotypefilter & """"
Me.FilterOn = True
End If
Else
If Me.cbodeptfilter <> "" Then *Is this code right? filter based on department only?
Me.Filter = "Dept = """ & Me.cbodeptfilter & """"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
End If
Any help is greatly appreciated, I'm practically lost on this stuff. I've exhausted google and I don't know enough about the code to know what I'm doing exactly. I think my thought process is good but I don't know the syntax.![]()