Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop-down with null?

Status
Not open for further replies.

tredeker

IS-IT--Management
Feb 5, 2002
5
US
All,
I have a very simple form with a drop-down populated by a query. When the form first opens, the drop-down is empty. After opening the drop-down, the list of values appears as it should. What if the user does not want to choose any of the values and would rather leave the drop-down blank? Once they've viewed the list, they cannot select a blank value again.

Thanks,
TR
 
Hmmm, interesting. I've never had that problem with my combo boxes. If I don't want to select a value then I just collapse the list again without making a selection.

Do you have any required properties set like zero-length not allowed or null value not allowed? Maq [americanflag]
<insert witty signature here>
 
One way is to add an entry to the table that the Combo gets its info from saying 'None'. Then add an If statement to the Combos AfterUpdate event so that if the user selects None the box becomes Null e.g

If Me![Combo4].Text = &quot;none&quot; Then
Me![Combo4] = Null
End If

HTH

Nigel
 
Thanks for the tips. I've modified the query that populates the combo-box which essentially adds the “none” value via a union query:

SELECT Project_Descr, Project_ID FROM ProjectList
UNION select &quot;&quot;, null from ProjectList
ORDER BY Project_Descr;

Limit to List = Yes

This gives the user the ability to choose from the list a blank value. Otherwise they need to backspace through the text in the field. Some of my users need to see thier choices visually, I just hope this doesn't add un-necessary load on the database.

Thanks again for your help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top