473,394 Members | 1,671 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.

How to identify the data in the form has been modified?

I have a simple VB form with many controls. When user add/modify a
record....if the user click the form close button...system should show a
messagebox that "something is modified. Do you really want to close?"

Instead of writing code in each and every control on the form....is there
any betterway (may be at form-level) to identify that user has modified
"somewhere" in the form?

Thanks in advance

J Justin
Nov 21 '05 #1
2 1531
You can make one sub that contain all of this code:

Private myDataCh as Boolean = False

Private Sub myDataChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles TextBox1.TextChanged, _
TextBox2.TextChanged, CheckBox1.CheckedChanged
myDataCh = True
End Sub

"Justin" wrote:
I have a simple VB form with many controls. When user add/modify a
record....if the user click the form close button...system should show a
messagebox that "something is modified. Do you really want to close?"

Instead of writing code in each and every control on the form....is there
any betterway (may be at form-level) to identify that user has modified
"somewhere" in the form?

Thanks in advance

J Justin

Nov 21 '05 #2
Hello,
This is good solution but user could edit data, then decide to restore
original values ( manual ) and your script will tell him that there is a
change.
other solution is keeping all data in private variables and in a function on
the end just make comparison for each control.
and if there is change then ask user what to do

good luck

Galin Iliev
MCSD, MCAD.NET
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
You can make one sub that contain all of this code:

Private myDataCh as Boolean = False

Private Sub myDataChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles TextBox1.TextChanged, _
TextBox2.TextChanged, CheckBox1.CheckedChanged
myDataCh = True
End Sub

"Justin" wrote:
I have a simple VB form with many controls. When user add/modify a
record....if the user click the form close button...system should show a
messagebox that "something is modified. Do you really want to close?"

Instead of writing code in each and every control on the form....is there
any betterway (may be at form-level) to identify that user has modified
"somewhere" in the form?

Thanks in advance

J Justin

Nov 21 '05 #3

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

Similar topics

1
by: Brad H McCollum | last post by:
I'm writing an application using VB 6.0 as the front-end GUI, and the MSDE version of SQL Server as the back-end (it's a program for a really small # of users --- less then 3-4). I'm trying to...
32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
14
by: horos | last post by:
hey all, I'm a heavy perl user, not so much a java script user, and was wondering... perl has an extremely nice utility called Data::Dumper, which allows you to dump out the contents of an...
5
by: Peter | last post by:
I have 3 ASP.NET forms written in C#, I also have 3 frames (left, top and bottom) one for each form. My question is if I have data on one form in the bottom frame how do I access this data when I...
12
by: clintonG | last post by:
I can't tell you how frustrated I get when going to a web developer's website and observing he or she is an idiot that has not grasped the most fundamental element of usability: page title naming...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
10
by: Doug Bell | last post by:
Hi, I have an application that has a "Data Access Class" and "User Interface Class". It is for receiving Purchase Order data from one system and pushing processed transactions to another...
3
by: jpr | last post by:
Hello, I know that this is not the rule but need some help. My datbase has three tables: MASTER TEMPLATES FORMS I have a form which is based on a table named MASTER. I have a primary key...
3
by: Mai Phuong | last post by:
Hi all, I have table Demo: CREATE TABLE Demo ( ID int PRIMARY KEY, Name char(50), BeModified int DEFAULT(0) )
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.