Visual Basic Reference

Visual Studio 6.0

'item' (Error 524)

See Also

The specified error has occurred in the Automation object currently running.

The error commonly occurs when you attempt to save a zero-length string to a database. For example, this occurs when a TextBox control is bound to a date field (through a Data control), and the user attempts to set the field to "", and then clicks a button on the Data control. The Data control tries to save the record with invalid data, causing the message "Data type conversion error" to appear.

If you have a form containing many text box controls, you can prevent the error from occurring by using the Validate event to check the contents of the text box, and cancelling the user's attempt to move off the text box if its data is not valid.