473,569 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Assistance with Error Handling

Hello,
I need some assistance with error handling in an Access 2003 Project
form. The project is has a data source connection to a SQL Server 2000
database. The main form is named ‘frmSelectByTes t', and its subform's
‘Name' and ‘Source Object' properties are ‘frmSelectByTes tSub'. The
‘Default View' on the main form is ‘Single Form', and on the sub form
is ‘Continuous Forms'.

The users select the name of a test (uniquely identified by a value
called ‘TestShortName) from a bound combo box in the main form. In the
subform, there is another bound combo box that allows the user to
select the student's name. After the student's name is selected, the
user indicates the student's score for the test in a bound text box
called ‘TestScore'. The last bound text box that the user fills in is
‘TestGrade' which indicates the grade level at which the student was
tested.

In the table that is populated, StudentID, TestGrade, and
TestShortName form a unique index. This SQL Server 2000 unique index
was created with IGNORE_DUP_KEY. None of these fields can be NULL.
Only TestScore can be null, and is not part of the unique index.

So for the users, each record in the subform must have at least the
student name selected and the TestGrade filled in. I have validation
rules and text set up for the TestGrade field, as the values can only
be ‘0' or ‘1' or ‘2' or ‘3' or ‘4' or ‘5'. When the user exits the
TestGrade field, I need to save the record. If there is an error of
any kind, I need for the application to ignore any messages from SQL
Server so that I can express a singular custom message (for any error
event).

How can I do this?

Thank you for your help!

CSDunn
Nov 13 '05 #1
2 1980
Am Mon, 12 Jul 2004 14:15:52 -0700 schrieb CSDunn:
Hello,
I need some assistance with error handling in an Access 2003 Project
form. The project is has a data source connection to a SQL Server 2000
database. The main form is named ‘frmSelectByTes t', and its subform's
‘Name' and ‘Source Object' properties are ‘frmSelectByTes tSub'. The
‘Default View' on the main form is ‘Single Form', and on the sub form
is ‘Continuous Forms'.

The users select the name of a test (uniquely identified by a value
called ‘TestShortName) from a bound combo box in the main form. In the
subform, there is another bound combo box that allows the user to
select the student's name. After the student's name is selected, the
user indicates the student's score for the test in a bound text box
called ‘TestScore'. The last bound text box that the user fills in is
‘TestGrade' which indicates the grade level at which the student was
tested.

In the table that is populated, StudentID, TestGrade, and
TestShortName form a unique index. This SQL Server 2000 unique index
was created with IGNORE_DUP_KEY. None of these fields can be NULL.
Only TestScore can be null, and is not part of the unique index.

So for the users, each record in the subform must have at least the
student name selected and the TestGrade filled in. I have validation
rules and text set up for the TestGrade field, as the values can only
be ‘0' or ‘1' or ‘2' or ‘3' or ‘4' or ‘5'. When the user exits the
TestGrade field, I need to save the record. If there is an error of
any kind, I need for the application to ignore any messages from SQL
Server so that I can express a singular custom message (for any error
event).

How can I do this?

Thank you for your help!

CSDunn


Hello,

maybe you give the forms Error-Event (I think here you can examine
the Error Messages and display a custom error message) a chance or
use the grade fields "On Exit Event" or the forms "before Update"
Event to check the values of the fields and cancel the Update.

HTH
Karpi
<fluctuat nec mergitur>
Nov 13 '05 #2
Thank you for your help. I will look into this.

CSDunn

Hans-Joerg Karpenstein <hj***********@ web.de> wrote in message news:<pa******* *************** ******@web.de>. ..
Am Mon, 12 Jul 2004 14:15:52 -0700 schrieb CSDunn:
Hello,
I need some assistance with error handling in an Access 2003 Project
form. The project is has a data source connection to a SQL Server 2000
database. The main form is named ?frmSelectByTes t', and its subform's
?Name' and ?Source Object' properties are ?frmSelectByTes tSub'. The
?Default View' on the main form is ?Single Form', and on the sub form
is ?Continuous Forms'.

The users select the name of a test (uniquely identified by a value
called ?TestShortName) from a bound combo box in the main form. In the
subform, there is another bound combo box that allows the user to
select the student's name. After the student's name is selected, the
user indicates the student's score for the test in a bound text box
called ?TestScore'. The last bound text box that the user fills in is
?TestGrade' which indicates the grade level at which the student was
tested.

In the table that is populated, StudentID, TestGrade, and
TestShortName form a unique index. This SQL Server 2000 unique index
was created with IGNORE_DUP_KEY. None of these fields can be NULL.
Only TestScore can be null, and is not part of the unique index.

So for the users, each record in the subform must have at least the
student name selected and the TestGrade filled in. I have validation
rules and text set up for the TestGrade field, as the values can only
be ?0' or ?1' or ?2' or ?3' or ?4' or ?5'. When the user exits the
TestGrade field, I need to save the record. If there is an error of
any kind, I need for the application to ignore any messages from SQL
Server so that I can express a singular custom message (for any error
event).

How can I do this?

Thank you for your help!

CSDunn


Hello,

maybe you give the forms Error-Event (I think here you can examine
the Error Messages and display a custom error message) a chance or
use the grade fields "On Exit Event" or the forms "before Update"
Event to check the values of the fields and cancel the Update.

HTH
Karpi
<fluctuat nec mergitur>

Nov 13 '05 #3

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

Similar topics

11
8734
by: Jim | last post by:
Hi, I keep getting form results emailed to me that would indicate a form from my web site is getting submitted with all fields blank or empty, but my code should preventing users from proceeding if they left any field blank. My guess is that someone is trying to hack the site using the form to gain entry or run commands -- I don't really...
106
6380
by: xtra | last post by:
Hi Folk I have about 1000 procedures in my project. Many, many of them are along the lines of function myfuntion () as boolean on error goto er '- Dim Dbs as dao.database Dim Rst as dao.recordset
2
2005
by: Rudy Ray Moore | last post by:
Whenever I get any error with Vc++7.1/.net/2003, it is followed by huge ammounts of "template assistance" error messaging referencing template code (MTL) that has nothing to do with the error. This makes it difficult to spot errors. For example, F4 to "jump to next error" just jumps ot the next "template assistance" message. And since...
3
2838
by: Stefan Johansson | last post by:
Hi all I'am moving from Visual Foxpro and have a question regarding "best practice" error handling in vb .net. In VFP I have always used a "central" error handling object in order to have a easy and reusable way of handling all errors in a program. The VB 6 coding examples I have seen there has always been error handling code in each...
4
1922
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I haven't placed error handling code). When I run my app from the IDE, the unhandled errors are caught by the error handling code in my Sub Main...
10
2273
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise...
2
1396
by: ===Steve L.=== | last post by:
does anyone know any site or ariticle provides exmaple for building a Global Error Handling Module in VB.Net? the module should be able to 1. prouduce friendly generic error msg for the users and gracefully exit the app. 2. capture vital error info for developers (such which application, where in the application, what type of error such as...
0
11561
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access Security, but I'll start with something short and simple This code was written in Access 2003 but should be valid in Access 2000 By default, when you...
9
3284
by: MrDeej | last post by:
Hello guys! We have an SQL server which sometimes makes timeouts and connection errors. And we have an function witch writes and updates data in 2 tables on this server. When the SQL server error appears it, in 99%, of the cases, works if we just press the play button in VBA debug. Therefor we have maked an error handling which just tryes...
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.