Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-06-23
1
Medium Priority
?
6,737 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 750 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses

610 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