473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Verify if the editing record has changed

Hi,

I am using VS2005. I have a form that I use both to insert new records and
modify existing records. I want that if the user tries to close the form,
the application asks the user to save changes only if the record has
actually changed.
The problem is that if I use EndEdit, an existing record that has been
modified becomes "Modified" (that's ok), but a new record after EndEdit
becomes "Added", whether it has been modified by the user or not. And if
some fields are not correct, it isn't possible to do an EndEdit, so I think
that this must be done somewhere before the EndEdit.
Is there a way to do this ?

Thanks,
Tom.
Mar 13 '06 #1
1 1074
The DataTable doesn't differentiate between a new record that has been
added, and a new record that has been added and also modified by the user
(i.e. the record does not just have default values).

If you want to be able to differentiate between these two different types of
new records, you need to write your own data source. Otherwise, I imagine
you would have to loop through every field to see whether or not they all
have their default values (user hasn't modified it) or at least one field
has a non-default value (user modified it).

"Tom Bianchi" <a@b.c> wrote in message
news:uq**************@TK2MSFTNGP12.phx.gbl...
Hi,

I am using VS2005. I have a form that I use both to insert new records and
modify existing records. I want that if the user tries to close the form,
the application asks the user to save changes only if the record has
actually changed.
The problem is that if I use EndEdit, an existing record that has been
modified becomes "Modified" (that's ok), but a new record after EndEdit
becomes "Added", whether it has been modified by the user or not. And if
some fields are not correct, it isn't possible to do an EndEdit, so I
think
that this must be done somewhere before the EndEdit.
Is there a way to do this ?

Thanks,
Tom.

Mar 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script...
5
by: Ryan | last post by:
I have some software (written in Delphi 5) which has been working for several months without a problem. I have been given a copy of the database on our development server (SQL 7) and have...
3
by: Oren | last post by:
Hi, I have an Access application with linked tables via ODBC to MSSQL server 2000. Having a weird problem, probably something i've done while not being aware of (kinda newbie). the last 20...
7
by: DKode | last post by:
I have a "Timesheet" application I am building for my company. The way I have the sql tables setup, is each day has a unique record for a specific user, then there is a TimeEntry table, that has...
0
by: Tom Bianchi | last post by:
Hi, I am using VS2005. I have a form that I use both to insert new records and modify existing records. I want that if the user tries to close the form, the application asks the user to save...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
12
by: dino d. | last post by:
hi everyone- my subject pretty much says it all- is there a secure way to do this? the non-secure ways are, as i understand it, to populate a listbox with indices as names, or maybe use a hidden...
1
ammoos
by: ammoos | last post by:
Hi Friends I have an issue in the MS Access Sub Form The Sub form contains Student Name, Address and one selection field(it’s a check box. in the database table, it specified as “Yes/No” field....
10
prn
by: prn | last post by:
Hi all, Among other things, I maintain an Access application that I have inherited from about a half-dozen previous maintainers. :( I got a call from one of the users to the effect that one of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.