requery field after every entry (1 Viewer)

kobiashi

Registered User.
Local time
Today, 08:34
Joined
May 11, 2018
Messages
258
hi

i have a continuous sub form with a combo box, how can i remove the previous selection from the combo box when i enter a new record?
 

June7

AWF VIP
Local time
Yesterday, 23:34
Joined
Mar 9, 2014
Messages
5,466
This is an UNBOUND combobox?What are you using it for? Requires code to set it to Null or empty string.
 

kobiashi

Registered User.
Local time
Today, 08:34
Joined
May 11, 2018
Messages
258
This is an UNBOUND combobox?What are you using it for? Requires code to set it to Null or empty string.

the combo box is bound to a query, im using it to choose names from a user table, so i dont want the user to be able to choose the same name twice
 

June7

AWF VIP
Local time
Yesterday, 23:34
Joined
Mar 9, 2014
Messages
5,466
If the combobox does not have a ControlSource then it is UNBOUND. If it is used to save value to field and you want to limit its list to values not already associated with a master record, that requires a RowSource query that includes data and lookup tables. Essentially a 'find unmatched' query. Or possibly using NOT IN() function.
 
Last edited:

GinaWhipp

AWF VIP
Local time
Today, 03:34
Joined
Jun 21, 2011
Messages
5,900
the combo box is bound to a query, im using it to choose names from a user table, so i dont want the user to be able to choose the same name twice

Combo boxes cannot be bound to a query. What is the Control Source of the Combo Box? If it does not have a Control Source then it is UNBOUND and you will need to put some code when going to the new record. However, where to put the code depends on show you are adding a new record. Are you using a command button or just going to the next record?

Side note, UNBOUND Combo Boxes in Continuous Forms are tricky because whatever you do for one record will show up for all.
 
Last edited:

Users who are viewing this thread

Top Bottom