Cascading Combo Boxes on a Form. (1 Viewer)

Local time
Today, 16:49
Joined
Jun 3, 2022
Messages
38
Hi,

I need help cascading combo boxes in a particular form, and I cannot figure it out. I am making a nonprofit database for our local community institution to make it easier for them to estimate business expenses, etc.

I have a form called "Resources" where community members can input data and enter their hourly rate for each upcoming year, which the form allows duplicates. For example:
Kate Johnson....Rate: 140... 2022
Kate Johnson....Rate: 150... 2023
Kate Johnson....Rate: 160....2024

Now when the user selects the form "Estimate Business." The user will click on the Year "2022," and the Combobox "Resource Name" shall generate the correct name with the individual rate.

For example, Kate Johnson has entered all her hourly rates for the upcoming years and opened the Estimate Business Form, selecting the year 2024. Her name comes up in the list of Resources, and it selects the correct hourly rate, 160.

I would appreciate the help! I've tried other forums and Youtube but cannot figure out the process.
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 17:49
Joined
May 21, 2018
Messages
8,529
In the resource combo
query.jpg

in the cmbos enter
Code:
Private Sub cboResourceName_Enter()
  Me.cboResourceName.Requery
End Sub
 

XPS35

Active member
Local time
Today, 23:49
Joined
Jul 19, 2022
Messages
159
No doubt MajP's answer will work.

But I advise you re-consider your table design. For example your resource table should be split in (at least) 2 two tables (resource and rate). You don't want to enter the resource name for every year. Tables category and ManageBr should be linked on CategoryID, I am sure there will be more things,
Build a proper model first. That will save al lot of problems later on.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 17:49
Joined
May 21, 2018
Messages
8,529
attached. I would move BR to top of the form. Since this links to the subform. I would give it primacy. Seems strange where it is. This is a confusing form to start with. You have data entry and a filtered subform. It is kind of like a split form but with the continuous form filtered. I did not look at tables or other issues.
 

Attachments

  • NonProfitDatabasev1.accdb
    4.8 MB · Views: 94
Local time
Today, 16:49
Joined
Jun 3, 2022
Messages
38
attached. I would move BR to top of the form. Since this links to the subform. I would give it primacy. Seems strange where it is. This is a confusing form to start with. You have data entry and a filtered subform. It is kind of like a split form but with the continuous form filtered. I did not look at tables or other issues.
MajP. Thanks for helping out. But i have a concern with the code created in the second form to search business reqs.

When I turn the file into a .accde file I receive an error message when trying to search for a field. "The expression on change you entered as the event property setting produced the following error: Invalid use of null."

Would you be able to see why this error is coming when I turn the file into a ".accde" executable file?
 

Users who are viewing this thread

Top Bottom