Help! Records being overwritten

SMatthews

New Member
Joined
Aug 5, 2002
Messages
18
I have a table with a Customer Name and a Customer ID column. There can be many Customer IDs for one Customer Name. I have a form that displays the Customer Names in a combo box (using an SQL statement to Group) and has a subform that displays the Customer IDs in datasheet view. I want users to be able to select a Customer Name and then update the Customer IDs. When they need to add a Customer, I have them click a command button which runs a macro that closes the current form, goes to a new record in the table and opens a new form (with a text box that they can enter the Customer Name in). After they enter the new Customer Name and click "DONE", the current form closes and the other form opens back up. The new Customer Name then appears in the combo box. Everything works fine except that whatever Customer Name was selected in the combo box when the user hits the command button to add a new record overwrites the Customer Name of the very first record in the table. I'm sure there is a better way to do what I am trying to do, so any help is much appreciated!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
It sounds like you have the control sorce for the combo box bound to the form which would cause you that problem.

removing the control source should cure it.

Peter
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,872
Members
451,674
Latest member
TJPsmt

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
Back
Top