Catch "New Record" in Detailsview.
-
Ok I have an Access DB and access it through the Detailsview control. One of the fields in my database is myID which is set in access to autonumber. In the Detailsview control "myID" field has been added as read only. When I press "New" to insert a new record the detailsview enters edit mode. Problem: myID field does not show, can set "visibleoninsert" to TRUE How do I enter a new record a new record and have the autonumber incremented for me??? I thought I would check the MAX number and add 1 then right back but to do this I need to catch the New Event. Any Ideas???
When people make you see red, be thankful your not colour blind.
-
Ok I have an Access DB and access it through the Detailsview control. One of the fields in my database is myID which is set in access to autonumber. In the Detailsview control "myID" field has been added as read only. When I press "New" to insert a new record the detailsview enters edit mode. Problem: myID field does not show, can set "visibleoninsert" to TRUE How do I enter a new record a new record and have the autonumber incremented for me??? I thought I would check the MAX number and add 1 then right back but to do this I need to catch the New Event. Any Ideas???
When people make you see red, be thankful your not colour blind.
-
If the myId is an auto-number column then you don't need to specify in the insert mode when you want to create a new row. That also means, you do not need to have a field to input for this value in the insert form.