Add Items for combo boxes through a form

beatified
beatified used Ask the Experts™
on
I am trying to create a way to add Vehicle Make and Model which makes sense. And am having trouble doing so.
You can see my preferred approach on things like "frmNewLeaseTerm" and  "frmNewState" Or on the form "frmNewLease" and clicking on the buttons for adding lease terms suffix or State.

I know this may not be the standard approach but it is the one I need as I need to make things extremely simple.

The problem I'm having is due to the fact that its using two tables "tblCarMake" and "tblCarModel"

My Goal would be to have it look like the attached picture but with an added button for "Add Model"
I also forgot how to open the form as a popup so if you could help with that as well I would be grateful.

Also I seem to be having a issue with the "New Tenant" button on the bottom of "frmNewLease" and also my dynamically updating combo boxes for make and model arent working right.

Thanks,
Stuart
Image-3.png
HCPV-Current_Backup.accdb
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software & Systems Engineer
Commented:
At first to open the form as popup just
DoCmd.OpenForm "TheNameOfTheForm", , , , , acDialog

Open in new window

if this what you want..
For the other part of your question i think the most widely used method in to use the NotInTheList event....so you just type what you want if the combobox and with a bit of code you get it inserted in the combobox...i use a small popup form to populate the new entry and if i have a case that i need to add more dynamic content i just continue on using the NotInTheList event ...and so on...
By the way...i just made a rental appartment application...well totally different concept...:)

Author

Commented:
Would you mind elaborating on the NotInTheList Event? Sounds like it might be a more straight forward solution. I am personally a little worried that users might add duplicate options but with incorrect spellings that is why I wanted it to make it a little harder to add an entry in the list of options.

I'll give the dialog option a try though.

Author

Commented:
And Is there a way I can combine the dialog option with DoCmd.OpenForm "frmAddCarMake", , , , acFormAdd
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

John TsioumprisSoftware & Systems Engineer
Commented:
I don't think you can do much on the duplicate ...the users always make typing errors..that's a fact no matter what...in the form that performs the adding you could add some kind of search to at least do some search/partial match.
As for the NotInTheList event here is a tutorial

Author

Commented:
Ok got the Dialog thing figured out. Just did it through a macro.
Fabrice LambertConsulting
Distinguished Expert 2017

Commented:
I agree with John, there is not much you can do about typing mistakes.
Enforcing everything in uppercase (with the Ucase function) or in lowercase (with the Lcase function) will remove some.

Author

Commented:
Great thanks guys. I'll look into the NotInTheList Event and maybe try to do some partial matching in msgbox's and warn the user that there might already be appropriate options in the list.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial