how do i fix a combo box to allow selection of "blank"?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want an option in the combo box to allow the field to be set back to null
if they previously selected a value. the list in the combo box is created
from a lookup.
 
The only way I've made it work is through the use of a Union query. There
may or may not be something built in to Access to handle this...I don't
know.

In the Rowsource of the Combo Box type something like this:

SELECT DISTINCT [Field] FROM [YourTable] UNION SELECT Null FROM [YourTable];

That should do it.

Good luck

T
 
I've used this code many times. The key is to trap if the word "Blank"
is selected.

SELECT [Field]
FROM


UNION SELECT "Blank" as [Expr1]
FROM
;

In your AfterUpdated of your combo box use this code

If Me![ComboBoxName] = "Blank" Then
Me![ComboBoxName] = Null
End If

Hope this helps



The only way I've made it work is through the use of a Union query. There
may or may not be something built in to Access to handle this...I don't
know.

In the Rowsource of the Combo Box type something like this:

SELECT DISTINCT [Field] FROM [YourTable] UNION SELECT Null FROM [YourTable];

That should do it.

Good luck

T

accessdenied said:
I want an option in the combo box to allow the field to be set back to null
if they previously selected a value. the list in the combo box is created
from a lookup.
 
Back
Top