Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cancel Add Record in DataGrid
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00408290
Message ID:
00408312
Views:
17
>The Situation:
>
>1. The user Enters a value into the "insert row" of the datagrid.
>2. The user decides they don't want to insert the row anymore.
>3. They click somewhere else on the grid.
>4. An error results stating:[Microsoft][ODBC Microsoft Access Driver] The field 'Rates.EffectiveDate' cannot contain a null value because the required property of this field is set to True. Enter a value in this field.
>
>I realize #4 is b/c the datagrid is still trying to add the record but I need to know what event I can put code in that will check if all fields are entered and if they are: save the record. Otherwise leave the data in the "insert row" but not try to save it to the database.

I prefer to use the DataGrid for displaying or modifying very simple data. When adding or modifying more complex data, I prefer to have a frame containing other controls (textbox, combobox, ...) that normally allow user a better experience. Also, as a programmer, it is much more simpler!

Back to your question, can't you have a default value for that field?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform