Combo based on combo

t3nchi

Registered User.
Local time
Today, 17:05
Joined
Sep 28, 2005
Messages
79
I have 2 combo boxes. 1 is year, the other is company. Let's called them 'cboYear' and 'cboCompany'.

The fields inside the combo boxes are from tables called 'Year' and 'Company'. I select from a drop down menu and populate a table called 'Audit Records'.

I would like to create a form that basically does this :

I select a year, then the cboCompany refreshes and shows me ONLY the relevant companies that have that specific year.

How do I do that? The problem is that when I select a year, the 2nd combo box shows ALL the companies (unfiltered).

p/s :I've tried reading webpages, did not help, only confused. I am relatively new to access.
 
RuralGuy said:
Here's some more reading for you: Cascading Lists for Access Forms

Also search this Forum for Cascading and see what turns up.

By the way, Year is a reserved word. Sorry, more reading!
List of reserved words in Access 2002 and Access 2003
List of Microsoft Jet 4.0 reserved words
Special characters that you must avoid when you work with Access databases

Thanks rural. It's actually called 'yearAudit' but I just used 'year' to simplify. Didn't know it was reserved though, so thanks.

While we're here could I ask another question?

I don't want any edits I make to be saved UNTIL I hit the 'save' button. Any idea where I could look this info up?
 
ghudson has a good solution on this forum somewhere. Maybe he will see this thread. I can't remember if it was his MouseTrap stuff.

I would set a Public form flag and check it in the BeforeUpdate event. If the user did not push your "Save Button" (where you reset the flag) then Cancel the event. (Cancel = True) Just so you understand that you can get the user trapped unless you provide a way out without saving. Ask them in the BeforeUpdate event and use Me.Undo if they want out.
 
Last edited:
RuralGuy said:
ghudson has a good solution on this forum somewhere. Maybe he will see this thread. I can't remember if it was his MouseTrap stuff.

I would set a Public form flag and check it in the BeforeUpdate event. If the user did not push your "Save Button" (where you reset the flag) then Cancel the event. (Cancel = True) Just so you understand that you can get the user trapped unless you provide a way out without saving. Ask them in the BeforeUpdate event and use Me.Undo if they want out.

don't know if it's just my PC but the first link didn't work.
 
another question,sorry.

I have now gotten the part where I select the 'Year' and the correct 'Companies' show up. Now I want to click and select a company from that list, and I want the rest of the form to change accordingly.

Subform? What's master/child anyway, I was tinkering with it, couldn't work it out.

Thanks.
 
never mind, a search in the forums did the trick.
 

Users who are viewing this thread

Back
Top Bottom