Solved

how to catch Run time error '-2147467529 (80004005)'

Posted on 2008-06-23
1
6,271 Views
Last Modified: 2013-12-25
i have a database and everytime when user tryinig to save a duplicate record , the error mesage should state
you can not save the record, because the record existed
I have :
rs!RecNum=txtrecnum.text
rs!AccountName=txtAccountName.text
rs!Name=txtName.text
if err.number=-2147467529 then
msgbox "you can not save the record, because the record existed"
exit sub
else
rs.update
end if
0
Comment
Question by:rfedorov
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 250 total points
ID: 21853649
Did you try something like this ? Can you tell me what goes wrong with your code ?

private sub SaveRecord()
on error goto myError
rs!RecNum=txtrecnum.text
rs!AccountName=txtAccountName.text
rs!Name=txtName.text
rs.update
exit sub
myError:
if err.number=-2147467529 then
    msgbox "you can not save the record, because the record existed"
end if
exit sub
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now