I have a table with an autonumber field and a char field. I have a query that sorts that table by the a character field, and return the key field as well (the autonumber field).
I also have a form with a combobox that uses that query as its source, it displays the character field, but saves the key field in another table. In that other table, 0 is the default value for that number field, and I want it to keep that 0 when an invalid selection is made in the combobox (if someone types in anything that is not in the query), or if after an item has been selected the user changes his mind and wants to leave it blank (blank is not in the query, so it is not accepted)
So my question is: is there a way to set the field to 0 when the user types in into the combobox, or when he deletes what is in the combobox? (of course again, when such entry is not in the query)
I think I could solve this by having the autonumber start at 0, and assign the string "select" to it, but I do not know how to start an autonumber from 0 either. If there is any other better approach, I am open to sugestions.
Thanks for your help.
I also have a form with a combobox that uses that query as its source, it displays the character field, but saves the key field in another table. In that other table, 0 is the default value for that number field, and I want it to keep that 0 when an invalid selection is made in the combobox (if someone types in anything that is not in the query), or if after an item has been selected the user changes his mind and wants to leave it blank (blank is not in the query, so it is not accepted)
So my question is: is there a way to set the field to 0 when the user types in into the combobox, or when he deletes what is in the combobox? (of course again, when such entry is not in the query)
I think I could solve this by having the autonumber start at 0, and assign the string "select" to it, but I do not know how to start an autonumber from 0 either. If there is any other better approach, I am open to sugestions.
Thanks for your help.