UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Combobox Issue, Access 2010    
 
   
dzoker
post May 22 2019, 12:57 PM
Post#1



Posts: 432
Joined: 12-February 14



Hi,

I have a combobox on a Datasheet subform. The combobox picks up records from a table that have 4 different records. What I would like to have is prevent thew user to use the same record from the combobox that was previously used. So basically dynamically limit the combobox list based on what was used already.
This post has been edited by dzoker: May 22 2019, 12:58 PM
Go to the top of the page
 
theDBguy
post May 22 2019, 01:09 PM
Post#2


Access Wiki and Forums Moderator
Posts: 75,508
Joined: 19-June 07
From: SunnySandyEggo


Hi. You should be able to use a WHERE condition in the Row Source of the combo, but you'll have to Requery it everytime the user moves from one record to another.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
dzoker
post May 22 2019, 01:15 PM
Post#3



Posts: 432
Joined: 12-February 14



Hi theDBGuy,

Can you please explain a bit more? The where condition should be against what?

ty
Go to the top of the page
 
theDBguy
post May 22 2019, 01:33 PM
Post#4


Access Wiki and Forums Moderator
Posts: 75,508
Joined: 19-June 07
From: SunnySandyEggo


Against the table bound to the form. For example, let's say the combo is based on Table1 and the form is based on Table2, then your row source will be something like (pseudocode) "SELECT rows from Table1 WHERE rows are not in Table2." So, basically, you're limiting the rows to display by excluding those rows already selected.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
dzoker
post May 22 2019, 02:29 PM
Post#5



Posts: 432
Joined: 12-February 14



TheDBGuy,

ty
Go to the top of the page
 
theDBguy
post May 22 2019, 02:34 PM
Post#6


Access Wiki and Forums Moderator
Posts: 75,508
Joined: 19-June 07
From: SunnySandyEggo


Hi. You're welcome. However, there is a catch. Often, we think we want something, and it's definitely possible, but when we finally get it to work, we find out there are some side effects we may not have expected. This is one of those cases. I'll let you experiment for a while and come back if you find any side effects you didn't expect or don't like. Good luck!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th June 2019 - 06:14 AM