Protect Data in a Combo Box

TheSearcher

Registered User.
Local time
Today, 04:47
Joined
Jul 21, 2011
Messages
404
I have a combo box using a query for a rowsource. I have the "Limit to List" property set to Yes and the "Allow Value List Edits" property set to No. But the user can still change or delete the data - and this causes the program to crash. If I set the "Locked" property to Yes then nothing can be selected. What can I do to protect the data in my combo box?

Thanks,
TS
 
Use the BeforeUpdate event to qualify the changes.
 
use the NotInList event of the combo:

Private Sub combo_NotInList()
Response=acDataErrDisplay
end sub
 
...But the user can still change or delete the data...

Or are you saying that the user can simply delete a selection that has been made or enter a value by typing it into the Combobox...and this is what you want to prevent?

Linq ;0)>
 
Pat Hartman - The combo box is not bound to any table. It's rowsource is an sql query that executes in the "on open" event of the form.
Missinglinq - Yes that is correct. The user can actually delete the contents of the combo box leaving a null value and thereby causing the program to crash. I addressed this by putting code in both the "Before Update" and "After Update" events to check for a null value. That seems to be working.
 

Users who are viewing this thread

Back
Top Bottom