combo box duplicates

j3andc

Board Regular
Joined
Mar 4, 2002
Messages
172
I am using a combo box to populate data. I have 6 records currently in the table and 3 of them are the same. The combo box is listing all 3 when I am trying to select a new one. I want the list to only show the duplicates one time. How do I do this?

Jim
 
Control Source does list the correct field.

The combo box list updated only after I closed down the database and reopened it.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
you probably need to add an event to requery the Combo box when you change record so that it gets the added value.

Private Sub Form_Current()
Me.MyCombo.Requery
End Sub

changing MyCombo for the name of your combo box.

HTH

Peter
 
Upvote 0
I am getting an error message stating that I must save the record first. Is there a way to update the record (save) when I hit the tab key or pick another field?
 
Upvote 0
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord

Should do it but I thought that saved the record before the onCurrent event fired anyway.

Peter
 
Upvote 0
Private Sub Form_Current()
Me.MyCombo.Requery
End Sub

In the above, do I replace the word Form with the name of the Form?
 
Upvote 0
nope, the me is OK as long as you are in the form module but you do need to change the MyCombo unless I struck lucky :)
 
Upvote 0
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord

I can not get this to work.
 
Upvote 0
Do you have any other code running? I have just built a test form and it works fine, i cannot replicate your error msg

Peter
 
Upvote 0
it would go before the requery line but I did not need it in my test

Peter
 
Upvote 0

Forum statistics

Threads
1,221,810
Messages
6,162,108
Members
451,743
Latest member
matt3388

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