473,394 Members | 1,770 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,394 software developers and data experts.

Way to find out whether a Record in the form is changed or not ?

Is there any way to find out whether a record in the form is changed or not.
Say we are having a customer Form, where user can create or view customers.
When the user hits the Close/Exit icon, we want to find out whether the user
has done any changes or not ?
If there are changes, then we want to prompt the user to save them first. So
we want to set a flag whenever the user "Changes" any field in the record ,
so that we can identify whether a record is "Dirty" or not.

what are the alternatives ?

- Anand
Nov 21 '05 #1
6 1073
Anand,

That depends what is a record.

When it is a row from a datatable, than you can check if a datatable
"haschanges" and than check the "rowstate" of the datarows in that.

I hope this helps?

Cor
Nov 21 '05 #2
More clarification :

We are talking to the db in the following manner.
The ui fields will be converted as a customer object and passed on to our
dblayer, which will write the insert statements etc. We are not using
datatable or datarows in the VB form.
so,in this case, we want to write some code in the form, to set a flag
anytime the user has made any change to any field.

Anand,

That depends what is a record.

When it is a row from a datatable, than you can check if a datatable
"haschanges" and than check the "rowstate" of the datarows in that.

I hope this helps?

Cor

Nov 21 '05 #3
Anand,

Are you using databinding?

Cor
Nov 21 '05 #4
No, we dont

"Cor Ligthert" wrote:
Anand,

Are you using databinding?

Cor

Nov 21 '05 #5
Anand,

Than I think can be a solution to set first all your values to a hashtable
and check those using the names of the textboxes you use to the current
value when the user ends.

(In fact is this completly build in, in the datarow.rowstate.)

However just a thought because I never did it like this.

Cor
Nov 21 '05 #6
I went through this when I first started vb.net. All I did was make
hidden labels with the same information off the screen and compared
those values when the user tried to exit (not the most efficient way,
but it works). That was when I didn't want to invest much time in
learning a faster way to do it. Cor's solution is probably much more
efficient.

Nov 21 '05 #7

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

Similar topics

3
by: Liz Malcolm | last post by:
Hello and TIA for guidance. I am building a reusable search procedure (thanks go to Graham Thorpe for his example that set me on my way). Everything works up until the 2nd match is found, the...
4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
2
by: RC | last post by:
I am getting the following error message. "Write Conflict this record has been changed by another user since you started edting it. If you save the record, you will overwrite the changes...." I...
4
by: Ryan | last post by:
Access 2002, Windows XP, 1 Front end MDB, 1 Back end MDB I have a subform which points to a table. Navigating from one record to the next is obviously dead straight forward. However, this seems...
19
by: rich | last post by:
I am building an app using php and postgresql. My questionis this. How do you handle people wanting to make parallel changes to a record. Since in web apps you are doing a select, bring over a...
1
by: foothills bhc | last post by:
I have a problem with verifying content of controls on a form before closing the form or moving to the next form "record" (i.e., when moving to the next row of my form's record source). HERE'S THE...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
10
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching ComputerID, and 3. Opens the query qryEditData, and...
4
by: Michael R | last post by:
Hi everyone. For a coding of something which seem too long to explain, I need to find out, by .recordset or any other way, whether or not I (the user) am standing on the new record row in a form....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.