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

Issue with data change confirmation using Me.Dirty function

79 64KB
I applied below code to remind user and confirm any data change of record in all forms before they leave the record or close the form.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  
  3.     Dim CnfrmSave As Integer
  4.  
  5.           If (Me.Dirty = True) Then
  6.  
  7.       CnfrmSave = MsgBox("Record Changed." & vbCr & vbCr & "Proceed with Changes?", vbYesNo + vbExclamation, "Caution!")
  8.               If CnfrmSave = vbNo Then
  9.               Me.Undo
  10.  
  11.               Else
  12.               MsgBox "Record changes will be saved", vbOKOnly + vbInformation, "Changes will be Saved"
  13.  
  14.               End If
  15.            End If
  16.  
  17. End Sub
  18.  
  19.  
It works fine except in the datasheet form. When I opened a datasheet form to edit data, when moving to different row, the following error message appeared.

“The expression BeforeUpdate you entered as the event property setting produced the following error: A problem while Your System was communicating with the OLE server or ActiveX Control.”

What does this error message mean and how to correct the problem?

Another thing I need help with this is that some forms contain SubForm. When I change data in SubForm and leave the MainForm record, the codes did not apply (nothing happened). How to make this design to cover the data changes in SubForm?

Thanks.
Nov 3 '11 #1
2 2684
jimatqsi
1,271 Expert 1GB
Making the subform dirty does not make the main form dirty. You have to place the same code on the subform.

You should ask only one question in each post.

I'm sorry, I cannot offer any help about the datasheet mode except the obvious, have you put any Active/X controls in your form? Maybe they don't work well with datasheet mode. I never use that mode.

Jim
Nov 4 '11 #2
Joe Y
79 64KB
I just created the same datasheet from scratch again and the problem seems resolved. Something may have happened during my first time creation of this datasheet form.

I will submit a new post regarding the SubForm question.

Thanks.
Nov 4 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Jim Geissman | last post by:
Take a table, where not all the columns are populated: CREATE TABLE #T (A int, B int, C int, D int) INSERT #T (A,B) VALUES (1,2) INSERT #T (A,B) VALUES (3,4) INSERT #T (A,B) VALUES (5,6)...
2
by: Ben | last post by:
Hi. I have a button that change a number of images src's when I click a button. The src's are stored in an array and I just use document.src=pics to change the src of the image. However I want...
6
by: seeknew | last post by:
Hi, Here is the table we are using: create table testable(testcolA varchar(2000), testcolB varchar(500); When we query this table using the following query select LOWER(testcolA) from...
0
by: metamedia | last post by:
How do I get a datagrid to register a data change from a custom control cell (combobox) I've got a Windows Application with a Windows Form Datagrid that has a custom combobox column. When the user...
2
by: José Manuel (JMN CandyBeat) | last post by:
Hello. I'm moving from Visual C++ 6.0 to Visual C++ .NET 2003 and I saw the changes to the streams. I'm rewriting my code and finished doing it yesterday. All seemed to be right, but the file...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
12
by: Angel Tsankov | last post by:
I'm thinking about using a function tamplate to verify that an identifier is of an array type. May the following template be used for this purpose: template< typename T, int N > void...
3
by: ncsthbell | last post by:
I am trying to run a query in access using the 'max' function. For example, I have many rows of data, one for each state and each state has a column for 'Miles'. I want to get the highest number of...
2
by: donthomasino | last post by:
i get error c2886( when i use using std::cout; using std::string;) and when i change to (using namespace std; using namespace std;) i got error c2059 #include <iostream> #include <string>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.