Hi:
I need to try this a different way.
I have a datagrid in VB 6.0 and the user can add new records. I want to
validate the record before it is saved and, if a particular cell is not
completed, I don't want the program to save the record when the user moves
off of it.
If I put code in the Before_Update event checking for the required data and
the data isn't there, I can do "Cancel = true"...then I get a message that
says "Action is Cancelled"... It doesn't allow me to put in my own message.
I can use vbdataerrcontinue, and the error message is not shown, but the
record is saved.
How do I keep the record from saving with my own message and not a "program"
error message?
Thanks for any assistance.
JP 4 9597
"Joe-Paul" <Ha*********@comcast.net> wrote in message
news:1c********************@comcast.com... If I put code in the Before_Update event checking for the required data and the data isn't there, I can do "Cancel = true"...then I get a message that says "Action is Cancelled"... It doesn't allow me to put in my own message. I can use vbdataerrcontinue, and the error message is not shown, but the record is saved.
I think you need to trap the "Action is Cancelled" message in the Error event of
the datagrid, set the Error event's Response parameter to 0 (vbDataErrContinue),
and do your message there.
Steve...thanks
I've used the vbDataErrContinue and the message is suppressed. But the
record is still saved. I don't want it to save that record.
JP
"Steve Gerrard" <my********@comcast.net> wrote in message
news:7u********************@comcast.com... "Joe-Paul" <Ha*********@comcast.net> wrote in message news:1c********************@comcast.com... If I put code in the Before_Update event checking for the required data and the data isn't there, I can do "Cancel = true"...then I get a message that says "Action is Cancelled"... It doesn't allow me to put in my own message. I can use vbdataerrcontinue, and the error message is not shown, but the record is saved.
I think you need to trap the "Action is Cancelled" message in the Error event of the datagrid, set the Error event's Response parameter to 0 (vbDataErrContinue), and do your message there.
"Joe-Paul" <Ha*********@comcast.net> wrote in message
news:uv********************@comcast.com... "Steve Gerrard" <my********@comcast.net> wrote in message news:7u********************@comcast.com... "Joe-Paul" <Ha*********@comcast.net> wrote in message news:1c********************@comcast.com... If I put code in the Before_Update event checking for the required data and the data isn't there, I can do "Cancel = true"...then I get a message that says "Action is Cancelled"... It doesn't allow me to put in my own message. I can use vbdataerrcontinue, and the error message is not shown, but the record is saved.
I think you need to trap the "Action is Cancelled" message in the Error event of the datagrid, set the Error event's Response parameter to 0 (vbDataErrContinue), and do your message there.
I've used the vbDataErrContinue and the message is suppressed. But the record is still saved. I don't want it to save that record.
JP
Don't use vbDataErrContinue in the BeforeUpdate event. Setting Cancel =
vbDataErrContinue is the same as Cancel = False, hence the record is saved.
Set Cancel = True. Then in the Error event, set Response = vbDataErrContinue.
Thanks Steve... It just takes a sledge hammer at times to get through my
thick skull...
It's now late...and I'll try it tomorrow.
Thanks Again,
JP
"Steve Gerrard" <my********@comcast.net> wrote in message
news:Nr********************@comcast.com... "Joe-Paul" <Ha*********@comcast.net> wrote in message news:uv********************@comcast.com... "Steve Gerrard" <my********@comcast.net> wrote in message news:7u********************@comcast.com... "Joe-Paul" <Ha*********@comcast.net> wrote in message news:1c********************@comcast.com...
If I put code in the Before_Update event checking for the required data and the data isn't there, I can do "Cancel = true"...then I get a message that says "Action is Cancelled"... It doesn't allow me to put in my own message. I can use vbdataerrcontinue, and the error message is not shown, but the record is saved.
I think you need to trap the "Action is Cancelled" message in the Error event of the datagrid, set the Error event's Response parameter to 0 (vbDataErrContinue), and do your message there.
I've used the vbDataErrContinue and the message is suppressed. But the record is still saved. I don't want it to save that record.
JP
Don't use vbDataErrContinue in the BeforeUpdate event. Setting Cancel = vbDataErrContinue is the same as Cancel = False, hence the record is saved.
Set Cancel = True. Then in the Error event, set Response = vbDataErrContinue. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: johnson_cy |
last post by:
I am using Access 2000.
My main form has a record source of a table (employeeTbl with key of
. It is filtering the record results.
My subform and mainform have the link child/link master set...
|
by: Sue Bricker |
last post by:
Hi, again.
I have a piece of code behind a form that is producing the following
error:
"Too few parameters. Expected 1."
However, it certainly looks like I have the parameters there. ...
|
by: Arif |
last post by:
My programs searches the header of input barcode in index file. Get the
record position next to Barcode header. Then moves the file pointer of
products file to reach that record.
My products...
|
by: LP |
last post by:
I am using (trying to) CR version XI, cascading parameters feature works it
asks user to enter params. But if page is resubmitted. It prompts for params
again. I did set...
|
by: sara |
last post by:
I think I don't understand combo boxes and forms - and all that I'm
reading is just confusing me more.
I am doing a "favor" for a non-profit organization. They take a phone
call and need to...
|
by: dk4300 |
last post by:
Hi!!
I have a subform with a comments (memo) field, linked to a form.
On the Memo field:
Properties-Other-Enter Key Behavior = New Line in Field
On the subform:
Properties- Other- Cycle =...
|
by: bhrosey via AccessMonster.com |
last post by:
I have a table that I use as a lookup reference on a form. The table
includes the employee name and a yes/no field that gets checked whenever the
employee leaves the company. Obviously I don't...
|
by: burttonboarder |
last post by:
I'm working on a rails project where I have a table called people and a table called addresses.
Each person can have many addresses. I've created a form which includes fields from both the People...
|
by: Jan |
last post by:
Hi:
Here's a problem I've had for a long time. The client is really running
out of patience, and I have no answers.
Access2003, front- and back-end.
Single form with 4 subforms (each...
|
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...
|
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,...
|
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...
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |