Combo Box Duplicates

  • Thread starter Thread starter DontellTrevell via AccessMonster.com
  • Start date Start date
D

DontellTrevell via AccessMonster.com

When user selects an item in a combo box
that is already selected and stored in a data table. (1) I want the item
ghosted or not visible in the combo box. or (2) Give user a msgbox that
says record has already been selected.
 
What's the RowSource of your combo box? You need to use a query that only
returns those rows that aren't stored in the data table, and requery after
each update of the data table.
 
The RowSource is: SELECT [tblBTWNumbers].[ID], [tblBTWNumbers].[BTWNumbers]
FROM tblBTWNumbers;
 
So, as recommended, create a query that joins tblBTWNumbers to the data
table and only returns those values in BTWNumbers that don't exist in the
data table.

Something like:

SELECT [tblBTWNumbers].[ID], [tblBTWNumbers].[BTWNumbers]
FROM tblBTWNumbers LEFT JOIN DataTable
ON tblBTWNumbers.ID = DataTable.ID
WHERE DataTable.ID IS NULL


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DontellTrevell via AccessMonster.com said:
The RowSource is: SELECT [tblBTWNumbers].[ID],
[tblBTWNumbers].[BTWNumbers]
FROM tblBTWNumbers;

What's the RowSource of your combo box? You need to use a query that only
returns those rows that aren't stored in the data table, and requery after
each update of the data table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top