Hi,
I don't want the user so see a message like "index or primary key can
not contain a null value". Instead, I'd like to use a user-friendly
message box.
I have tried putting code in the BeforeUpdate Event to check if the
field is empty, but I get my message plus Access' one.
How do I suppress the messages by Access?
I am using 2003.
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- 7 2076
pw wrote: Hi,
I don't want the user so see a message like "index or primary key can not contain a null value". Instead, I'd like to use a user-friendly message box.
I have tried putting code in the BeforeUpdate Event to check if the field is empty, but I get my message plus Access' one.
How do I suppress the messages by Access?
I am using 2003.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You can use the Form's OnError event procedure to trap errors like that.
Also, In the form's BeforeUpdate event procedure I run a function to
determine if all required controls have data. If they do I let the
record save. If they don't I cancel the save (Cancel = True).
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQnKJfIechKqOuFEgEQLwjgCfR+PwYYAxc+COtdjU6aJ5VA WHpdUAnjHs
Njne/5EB6plsknWxOwAWTuM8
=cajs
-----END PGP SIGNATURE-----
>pw wrote: Hi,
I don't want the user so see a message like "index or primary key can not contain a null value". Instead, I'd like to use a user-friendly message box.
I have tried putting code in the BeforeUpdate Event to check if the field is empty, but I get my message plus Access' one.
How do I suppress the messages by Access?
I am using 2003. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
You can use the Form's OnError event procedure to trap errors like that.
I did, and the error is still showing up. I found out what the error
number is:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim intAnswer_pw As Integer
If DataErr = 3058 Then
If IsNull(Me!txtStateAbbrev_pw) Or Me!txtStateAbbrev_pw = "" Then
strMsg_pw = "The state abbreviation can not be blank."
strTitle_pw = "State missing"
intButtons_pw = vbOKOnly
MsgBox strMsg_pw, intButtons_pw, strTitle_pw
End If
End If
End Sub Also, In the form's BeforeUpdate event procedure I run a function to determine if all required controls have data. If they do I let the record save. If they don't I cancel the save (Cancel = True).
Nice to know. Thanks!
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- You can use the Form's OnError event procedure to trap errors like that.
What I should have said is that I am still getting the "primary key"
error message in addition to mine.
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
pw wrote: pw wrote:
Hi,
I don't want the user so see a message like "index or primary key can not contain a null value". Instead, I'd like to use a user-friendly message box.
I have tried putting code in the BeforeUpdate Event to check if the field is empty, but I get my message plus Access' one.
How do I suppress the messages by Access?
I am using 2003.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
You can use the Form's OnError event procedure to trap errors like that.
I did, and the error is still showing up. I found out what the error number is:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim intAnswer_pw As Integer
If DataErr = 3058 Then
If IsNull(Me!txtStateAbbrev_pw) Or Me!txtStateAbbrev_pw = "" Then strMsg_pw = "The state abbreviation can not be blank." strTitle_pw = "State missing" intButtons_pw = vbOKOnly MsgBox strMsg_pw, intButtons_pw, strTitle_pw End If
End If
End Sub
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
To prevent the error from showing, in the OnError procedure you have to
set the Response parameter to acDataErrContinue. The Response default
is acDateErrDisplay, which means display the error message.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQnKoz4echKqOuFEgEQLfaACdEBUnND5mY+YV03R1ABFXYr 8jhNMAoKRT
DdEXcQjzXWbqpuVvqpb0aVhk
=XddZ
-----END PGP SIGNATURE-----
That did it! Thank you so much! pw wrote:pw wrote:
Hi,
I don't want the user so see a message like "index or primary key can not contain a null value". Instead, I'd like to use a user-friendly message box.
I have tried putting code in the BeforeUpdate Event to check if the field is empty, but I get my message plus Access' one.
How do I suppress the messages by Access?
I am using 2003.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
You can use the Form's OnError event procedure to trap errors like that.
I did, and the error is still showing up. I found out what the error number is:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim intAnswer_pw As Integer
If DataErr = 3058 Then
If IsNull(Me!txtStateAbbrev_pw) Or Me!txtStateAbbrev_pw = "" Then strMsg_pw = "The state abbreviation can not be blank." strTitle_pw = "State missing" intButtons_pw = vbOKOnly MsgBox strMsg_pw, intButtons_pw, strTitle_pw End If
End If
End Sub
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
To prevent the error from showing, in the OnError procedure you have to set the Response parameter to acDataErrContinue. The Response default is acDateErrDisplay, which means display the error message.
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- To prevent the error from showing, in the OnError procedure you have to set the Response parameter to acDataErrContinue. The Response default is acDateErrDisplay, which means display the error message.
If you don't mind me asking - how did you find out about that property
(acDataErrContinue). I searched the help and the books I have didn't
find anything about these properties!
Thanks again!
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
In news:9b********************************@4ax.com,
pw <***paulwilliamson@***spamcop.net> said: To prevent the error from showing, in the OnError procedure you have to set the Response parameter to acDataErrContinue. The Response default is acDateErrDisplay, which means display the error message.
If you don't mind me asking - how did you find out about that property (acDataErrContinue). I searched the help and the books I have didn't find anything about these properties!
It's not a property. It's a constant. Lookup the help for the OnChange
event.
--
regards,
Bradley
A Christian Response www.pastornet.net.au/response This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: annie |
last post by:
Hi all,
I have recently ported my Access 2000 app to SQL Server, keeping the
Access client as the front end using linked tables.
I am also using triggers on my SQL tables to trap orphan...
|
by: Yannick Turgeon |
last post by:
Hello,
We are in the process of examining our current main application. We have to
do some major changes and, in the process, are questionning/validating the
use of MS Access as front-end. The...
|
by: dog |
last post by:
I've seen plenty of articles on this topic but none of them have been
able to solve my problem.
I am working with an Access 97 database on an NT4.0 machine, which has
many Access reports.
I...
|
by: Grasshopper |
last post by:
Hi,
I am automating Access reports to PDF using PDF Writer 6.0. I've
created a DTS package to run the reports and schedule a job to run this
DTS package. If I PC Anywhere into the server on...
|
by: Dave Hansen |
last post by:
Please note crosspost.
Often when writing code requiring function pointers, it is necessary
to write functions that ignore their formal parameters. For example,
a state machine function might...
|
by: PW |
last post by:
Hi,
There is code in Alison Balter's excellant "Mastering Access 2003" to
create a list of error codes and descriptions but it only generates
error messages 3 through 94. Is there a website...
|
by: Don Li |
last post by:
Hi,
A web app server package that I'm using includes a bunch of open
source UI components (heavy with javascripts). Inevitably it has
bugs, e.g. "undefined" is null or not an object.
This...
|
by: hyperpau |
last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding.
I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com).
Ergo, I...
|
by: hyperpau |
last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding.
I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com).
Ergo, I...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |