Editing Combo Box list when values are tied to another table

superfly5203

Registered User.
Local time
Yesterday, 21:00
Joined
Apr 5, 2016
Messages
43
Hello,

I'm working on a access 2010 database, and I have one form that just about all the information for the database is entered into. I have a couple combo boxes for name of people, and one for Contract name. When I made the boxes, I linked the ones for names to the first_name field, in their corresponding tables. I added some code in the properties tab to select the last name too so you can see both the first and last name. Here is that code:
Code:
SELECT [tblCS].[CSID], [tblCS].[CS_First_Name] & " " & [tblCS].[CS_Last_Name] FROM tblCS;

I've run into a problem now where I can't add names to the combo box. I have the properties set to allow value list edits - yes, list items edit Form - my entry form. There is another one that says limit to list, and i can't change it from yes to no. There is the icon to update the list at the bottom, but when i click on it it doesn't bring up that pop up where I can add new names.

Does this issue have to do with the way I'm showing both first and last names? I can't change my contract name one either, and thats only pointing to one field. I do get an error talking about adjusting the column width, but I have no idea what that is talking about.

Thanks for any help.
 
Sorry I went back and read what I wrote and didn't even understand it, really sorry about that.

I have a a table for people's names, and there is a field for first name and a field for last name. I have a form, that is used to input data into several different forms. On this form, I have a combo box which is populated from the first name field in my people table. I need to add a new person to this combo box and it isn't letting me. You were right about the first and last name being displayed with code I provided in the op, I wasn't sure if that is what is giving me issues or not. If you need to know what settings I have I can tell you tomorrow morning. Thanks for the help.
 
yes it should.
 
The Row Source is:
Code:
SELECT [tblCO].[COID], [tblCO].[CO_first_name] & " " & [tblCO].[CO_last_name] FROM tblCO;

And the Control Source which points to my summary table, if it matters is :
Code:
Assigned_CO_ID
 
Although largely unknown, a new feature, as of v2007, makes this kind of thing easy to do, without any code. Presumably you have a Form to enter data into your tblCO Table, as data should never be directly entered into a Table.

In Design View, select the Combobox, then go to Properties - Data and go down to the List Items Edit Form property. Click into that box and use the arrow that pops up to select that Form.

If you enter an item in the Combobox that doesn't exist, when you move off of the cbo the selected Form will pop up, waiting for you to enter the new item. Do that, then close that Form. With out doing anything else, not even Requerying the Combobox, the item will now be in it!

There's something similar, I believe, to automate doing the same thing to interactively add an item to a Combobox that is based on a Value List.

Linq ;0)>
 
Thanks that worked great! I thought it would be something simple like that.
 
Glad it worked! As I said, it's a new feature that many people seem unaware of, as I see many old hands still advising posters to use the old method of using the Not in List Property and a bunch of code...for what is now a simply task!

Good luck with your project!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom