Use Two Combo Boxes To Filter a Continuous Form (1 Viewer)

AJJJR

Registered User.
Local time
Yesterday, 17:58
Joined
Mar 19, 2018
Messages
56
Hi. Seems that this should be easy, but I have spent the last two days, trying every imaginable method and have encountered nothing but weird problems.

This is a To Do list database, I'll simplify the data for clarity. There are tasks (what you have to do) and two levels to categorize them, Level and SubLevel. Each Sublevel is associated with a Level so that you could have identical values in the SubLevel field, differentiated by their Level. Level is a unique value.

I have 3 Tables

tblLevel
LevelName

tblSublevel
LevelName
SubLevelName

tblTasks
LevelName
SubLevelName
TaskName

I want to have a continuous form--frmTasks listing all the Tasks, and I want to filter the Tasks by Level and SubLevel, at the same time. So only tasks in the sublevel of the level would show.

frmTasks
In Header
cboLevelName
cboSubLevelName
In Detail
txtTask

The RecordSet for the form would be a query.

qryTasks
tblTasks.LevelName
tblTasks.SubLevelName
tblTasks.TaskName

Then I would set criteria for qryTasks.SublevelName as Forms![frmTasks]![cboSubLevelName]
and for qryTasks.LevelName as Forms![frmTasks]!cboLevelName

This didn't work, even if I eliminated cboSubLevelName and tried to filter with just the Level. The results are, in fact, quite strange. The query returns no records at all yet the form shows all records in the table?

Would really appreciate any suggestions as to what I'm doing wrong or a better way to approach this. I have tried several other methods of accomplishing this but to keep it simple I've started the question out here.

Thanks for your time
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:58
Joined
Oct 29, 2018
Messages
21,358
Hi. When filtering a form, I usually just use the Filter property. So, the form shows all the records, and the Filter property applies a criteria to display the requested records. I find this approach easier to troubleshoot than using a query.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 00:58
Joined
Jul 9, 2003
Messages
16,245
Hi. When filtering a form, I usually just use the Filter property.

I personally prefer using queries for some reason. I occasionally use the the filter option, and I did a video in answer to a particular OP question which may be of interest, but it's not exactly the same as your issue.

See:- Nifty Access - Filtering - MS Access Forms
 

AJJJR

Registered User.
Local time
Yesterday, 17:58
Joined
Mar 19, 2018
Messages
56
Hi. When filtering a form, I usually just use the Filter property. So, the form shows all the records, and the Filter property applies a criteria to display the requested records. I find this approach easier to troubleshoot than using a query.
So you're saying I can have the two comboboxes in the header and use their values to set a filter on afterupdate?
 

AJJJR

Registered User.
Local time
Yesterday, 17:58
Joined
Mar 19, 2018
Messages
56
I personally prefer using queries for some reason. I occasionally use the the filter option, and I did a video in answer to a particular OP question which may be of interest, but it's not exactly the same as your issue.

See:- Nifty Access - Filtering - MS Access Forms
Any Idea why my query doesn't work?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:58
Joined
Oct 29, 2018
Messages
21,358
So you're saying I can have the two comboboxes in the header and use their values to set a filter on afterupdate?
Yes, like a find as you type approach or like what most people do and use a search button to apply the filter.
 

Users who are viewing this thread

Top Bottom