By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

Access 97 - Error Message

P: n/a
Please help if you can.

I have a subform with a field on it that is set to have a required value.

The problem is that when the user does not fill out all the appropriate
information and tries to navigate to another record in the subform or main
form, the Access default message comes up saying that the value is required,
but in a very techincal way that the user will have no idea what it means.
I tried putting a message on the OnError event (it works) my message
appears, but then after my message comes up, the Access message comes up too
right after.

Is there a way to get rid of the default access message?

Thanks in advance,
Paul
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Paul,
This is one where I'd probably implement the business rule in code rather
than using the built-in property of a control. I gain two things by doing
this. First, I have a bit more work to do because I can't rely on Access to
catch the error for me. Second, I gain the control I want over how the
error/event is handled. In the past I have implemented my own error/event
handling system so that I and my client have some control over what happens
when an error or event occurs. Now if Microsoft would please implement
triggers in Jet . . .
"Paul" <pz****@rogers.com> wrote in message
news:yM********************@rogers.com...
Please help if you can.

I have a subform with a field on it that is set to have a required value.

The problem is that when the user does not fill out all the appropriate
information and tries to navigate to another record in the subform or main
form, the Access default message comes up saying that the value is
required, but in a very techincal way that the user will have no idea what
it means. I tried putting a message on the OnError event (it works) my
message appears, but then after my message comes up, the Access message
comes up too right after.

Is there a way to get rid of the default access message?

Thanks in advance,
Paul

Nov 13 '05 #2

P: n/a
Thanks Alan,

I was hoping to use Access to do the work for me. But since its doing
things that I don't want, I will have to do as you suggested.
Too bad there is no quick fix for this.
"Alan Webb" <kn*****@hotmail.com> wrote in message
news:gc********************@comcast.com...
Paul,
This is one where I'd probably implement the business rule in code rather
than using the built-in property of a control. I gain two things by doing
this. First, I have a bit more work to do because I can't rely on Access
to catch the error for me. Second, I gain the control I want over how the
error/event is handled. In the past I have implemented my own error/event
handling system so that I and my client have some control over what
happens when an error or event occurs. Now if Microsoft would please
implement triggers in Jet . . .
"Paul" <pz****@rogers.com> wrote in message
news:yM********************@rogers.com...
Please help if you can.

I have a subform with a field on it that is set to have a required value.

The problem is that when the user does not fill out all the appropriate
information and tries to navigate to another record in the subform or
main form, the Access default message comes up saying that the value is
required, but in a very techincal way that the user will have no idea
what it means. I tried putting a message on the OnError event (it works)
my message appears, but then after my message comes up, the Access
message comes up too right after.

Is there a way to get rid of the default access message?

Thanks in advance,
Paul


Nov 13 '05 #3

P: n/a
Paul wrote:
Please help if you can.

I have a subform with a field on it that is set to have a required value.

The problem is that when the user does not fill out all the appropriate
information and tries to navigate to another record in the subform or main
form, the Access default message comes up saying that the value is required,
but in a very techincal way that the user will have no idea what it means.
I tried putting a message on the OnError event (it works) my message
appears, but then after my message comes up, the Access message comes up too
right after.

Is there a way to get rid of the default access message?


I thought you could use the Error event of the form, setting Response to
acDataErrContinue. You have to cancel the navigation all right! because
a required field is, well, required.

I executed a small test, in A97, and it seems to work: no message of
Access. This is only with a single form, hang on... it does work with
subforms, too. I used the Error event in the subform.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #4

P: n/a
I tried it Alans way, and it works fine..But this is something I will
definitly note for next time.

Thanks,

"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:cq**********@news2.solcon.nl...
Paul wrote:
Please help if you can.

I have a subform with a field on it that is set to have a required value.

The problem is that when the user does not fill out all the appropriate
information and tries to navigate to another record in the subform or
main form, the Access default message comes up saying that the value is
required, but in a very techincal way that the user will have no idea
what it means. I tried putting a message on the OnError event (it works)
my message appears, but then after my message comes up, the Access
message comes up too right after.

Is there a way to get rid of the default access message?


I thought you could use the Error event of the form, setting Response to
acDataErrContinue. You have to cancel the navigation all right! because a
required field is, well, required.

I executed a small test, in A97, and it seems to work: no message of
Access. This is only with a single form, hang on... it does work with
subforms, too. I used the Error event in the subform.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #5

P: n/a
Paul wrote:
I tried putting a message on the OnError event (it works) my message
appears, but then after my message comes up, the Access message comes up too
right after.

Is there a way to get rid of the default access message?


Yes. In the on Error event, after your line of code for the message
box, type in:

Private Sub Form_Error(DataErr As Integer, Response As Integer)

If DataErr = <number for the data error you're trapping> then

Msgbox <whatever>

Response = acDataErrContinue

end if

End Sub

YOu can use a select statement or even dispense with an if or reference
to the dataerr number at all if you're OK.

Note that the DataErr argument refers to the err collection of errors
that you use in error trapping.

If your level is at the point where nothing what I wrote makes any sense
to you yet - and I'm not trying to be nasty here, Paul, we are all at
different stages in our infinite learning curves 8) - the main thing to
remember is the line:

Response = acDataErrContinue

after your message box.

All due respect to Alan, who is miles higher than I am in terms of
competence and experience, I personally try and have the structure of
the data tables do as much work as possible for me. It's too easy to
induce a bug or forgotten something or other when you are writing long
code to apply business rules in code called from the form rather
applying those rules via database structure.

For me, anyway... that comes from an Oracle background where one does
have triggers and things Alan is crying out for! 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.