471,601 Members | 1,209 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,601 software developers and data experts.

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 ‘frmSelectByTest', and its subform's
‘Name' and ‘Source Object' properties are ‘frmSelectByTestSub'. 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 1853
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 ‘frmSelectByTest', and its subform's
‘Name' and ‘Source Object' properties are ‘frmSelectByTestSub'. 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 ?frmSelectByTest', and its subform's
?Name' and ?Source Object' properties are ?frmSelectByTestSub'. 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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rudy Ray Moore | last post: by
3 posts views Thread by Stefan Johansson | last post: by
2 posts views Thread by ===Steve L.=== | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by CCCYYYY | last post: by

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.