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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

You Tried to Assign a Null Value to a Variable That Is Not a Variant Data Type

Status
Not open for further replies.

BikeToWork

Programmer
Jun 16, 2010
50
0
0
US
When a user enters a value in a combo box then deletes the value, the message in the subject line comes up and the user cannot exit the combo box until a non-null value is entered. I've tried to trap the error but have been unsuccessful so far. I tried putting code in the Change event for the combo box:

If IsNull(Me.cboDocID) then
Me.Undo
End if
but the error shows up before the change event. Any help would be most appreciated.
 
How are ya BikeToWork . . .

Remove or disable the code you mentioned in the [blue]On Change[/blue] event. Now ... what happens if you hit the [blue]Esc[/blue] key instead of deleting?

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Also you probably want any code in the afterupdate or beforeupdate event not the on change event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top