PDA

View Full Version : Visual Basic and Access


guest
11-29-2000, 02:13 AM
Hello,
I have aproblem which is kind of database(access) related.
I am working on visual basic application,
which is using data control.
The problem is whenever I delete the last record, i can not add a new one, the update.
please help
thank you in advance

mbergan
11-29-2000, 05:15 AM
need some more info to help you out...


------------------
Magne Bergan
President at
www.blackandwhitevalley.com (http://www.blackandwhitevalley.com)
magne@blackandwhitevalley.com

guest
11-29-2000, 01:44 PM
let's say that my database(table) has no
records ( could be empty at the beginning
or because I DELETED the last record.
Then I am trying to add a new record, however
since there are no records ( no current record) the database does not add it.
If I use "UpdateRecord" method - it forses
database to create a new record and add it.
But because of UpdateRecord - the Validate Event is not triggered, so I can not validate the "ID" before updatting.
The database doesn't update record if that specific ID already exists, but if user is trying to enter info and types Id that already exists, he is moved to that ID and he
looses all info typed before.
I would like to prompt user before.

Thank you very much
ev