Updating combo box data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good afternoon Access fans,

I have a combo box for CompanyName on my form. The combo gets it info from
a query that returns all CompanyName names, grouped, from tblMoldingSetup.
If I entered a new CompanyName in record 5, for record 6, I would like the
combo box to include the name of the new company.

Ex: Combo Box CompanyName has 4 names in the drop down: Adams, Benson,
Charles, Davis.

I add a new CompanyName, Ellis, in record 5.

When I go to add record 6, I would like to get Combo Box CompanyName to
display in the drop down: Adams, Benson, Charles, Davis, and Ellis.

Thanks in advance,
Rich
 
What table/field is the combo field bound to? If not CompanyName in tblMoldingSetup, then
it will never show.

Let's say the table/field your combo bound to is tblOrders/CompanyName. Then use the
CompanyName in tblOrders as the rowsource for your combo.
Every time a new name is entered, it will then appear in the next record as a choice.
 
Al,
I am using a a query based on the field CompanyName in the table
tblMoldingSetup. I am using a query so I do not get duplicates and can sort
the CompanyName in alphabetical order. All the query does is pick out any
ComapnyName names, Group them (so I don't get Company 1, Company 1, Company
1, Company 2, Company 2, Company 3, Company 3...) in my drop down and sort
them descending.

I do not know if I should be using a refresh for the form or the combo box
or the query or maybe all of the above.

Thanks,
Rich
 
Rich,
Not quite what I asked for...
I know you are using the CompanyName values from tblMoldingSetup as choices for your
combo, but are those values being entered into a different table (other than
tblMoldingSetup) on your form.
What is the table and field are you updating with these CompanyNames?? (the
ControlSource of the combo)

If it's another table other than tblMoldingSetup, then tblMoldingSetup still doesn't
contain that new CompanyName after it's been added.
If it is being entered into tblMoldingSetup, then a REQUERY of the combo should display
that new Name for all subsquent records.
 
Al,
I am querying all of the CompanyName in tblMoldingSetup for use in
tblMoldingSetup field CompanyName.


But Do.Cmd.Requery "CompanyName" worked like a charm, with _AfterUpdate(
)Thanks for the help.
Rich
 
Back
Top