Help filtering form based on the data from another table (1 Viewer)

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:24
Joined
Feb 19, 2002
Messages
43,275
Hope you never have a lot of rows in this table since you are dead set on using the worst method.
 

gojets1721

Registered User.
Local time
Yesterday, 23:24
Joined
Jun 11, 2019
Messages
430
Hope you never have a lot of rows in this table since you are dead set on using the worst method.
I know what you're saying and I'm working on it. This is a temporary fix. The core issue is that I don't have a full listing of all employees in a table. Powers that be have not allowed that yet. So I can't make a junction table between complaints and employees because the employees table doesn't exist
 

gojets1721

Registered User.
Local time
Yesterday, 23:24
Joined
Jun 11, 2019
Messages
430
@arnelgp One quick question. I've attached your sample DB with a slight change.

If I wanted the search form to also allow for the user to input a date range, how would you suggest building the code for that with your existing code?

Thanks!!
 

Attachments

  • SearchDemo (1).accdb
    512 KB · Views: 67

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:24
Joined
May 7, 2009
Messages
19,243
see your search form (also the code behind the search button).
 

Attachments

  • SearchDemo (1).accdb
    504 KB · Views: 79

gojets1721

Registered User.
Local time
Yesterday, 23:24
Joined
Jun 11, 2019
Messages
430
@arnelgp awesome! Thank you! Last question, I swear. Let's say I also wanted a 'complaint number' search field in that search form. How would you add that in the code?

I tried adding the below code in but I'm getting an 3075 error.
Code:
If Not IsNull(Me.txtComplaintCategory) Then
     sFilter = sFilter & "[ComplaintCategory] ='" & Me.txtComplaintCategory & "'"
End If
 

Attachments

  • SearchDemo (1) (1).accdb
    528 KB · Views: 64
Last edited:

Users who are viewing this thread

Top Bottom