Combobox

jakobt

Active Member
Joined
May 31, 2010
Messages
335
Having a form with an order from a order table.
I placed a combobox to lookup and enter the customerid in the order table.
Preferable I would like customer ID to be saved in the order table, but customer name to be looked up in the combobox.
The format of customerID field in the orders table is a number.
The sql in the combobox is select customer.name ; customer.id from customer and the control source is: customer

Now sometimes the customers are showing in the combobox. However sometimes they dont appear in the combobox? Often if I go to design view and back to form view the customers reappear in the combobox??
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
2,078
customer ID SHOULD be in the order.
The combo is a query from the customer table.
It may need refreshed if the customer is newly added.
CboBox.requery
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
2,449
Office Version
  1. 365
Platform
  1. Windows
customer.name ; customer.id
reverse them and make the bound field the first one, set it's width to zero and then only the name will show but the id value is what gets saved.
control source is: customer
I don't see how this is possible. The control can be bound to a field, not a table. You said the field name is 'name', which btw is a reserved word and you should not use it for object names. See
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,193
Messages
5,768,774
Members
425,492
Latest member
blueexcel123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top