473,657 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

capture error message: can't append all the records

7 New Member
I am importing text files and using the data to create the records for a table with keys.
If the user tries to import the same files twice, they get the huge error message that includes 'can't append all the records'. I know this is due to duplicate keys.
What I would like to do is capture that message before it goes to the user and give them a more friendly message like 'You have already imported this data'.
I tried to capture the error number in the error routine, but this error doesn't go to the error routine.
How can I pre-empt this error message and give it my own error message ?

09/19/06
June H. Kantner
Sep 19 '06 #1
3 4352
PEB
1,418 Recognized Expert Top Contributor
Hi,

How do you activate your import operation? Using what code of VB or using macro?

:)
Sep 19 '06 #2
jkantner
7 New Member
Hi,

How do you activate your import operation? Using what code of VB or using macro?

:)
-----------------
I use VB code.
I first import the records into an empty temp table.
'Process found files
If Len(.FileName) > 0 Then
For i = 1 To .Foundfiles.Cou nt
FoundFile_str = .Foundfiles(i)
DoCmd.TransferT ext acImportFixed, "SAP_Incoming_s pec", "Tmp_InBound_SA P", FoundFile_str, False
------
Then I process them into the main table using an append query.
'Now append the imported data to the table
DoCmd.OpenQuery "IS_SAP_ImportT mpToInbound_qry "
Sep 19 '06 #3
PEB
1,418 Recognized Expert Top Contributor
So,

In this case you can desactivate the error message with

docmd.setwarnin gs false

DoCmd.TransferT ext acImportFixed, "SAP_Incoming_s pec", "Tmp_InBound_SA P",

docmd.setwarnin gs True

But get the error from the execution of docmd.

In fact it isn't an error in VB that causes non execution of docmd

but internal error in the command docmd...

If there is something about this kind of errors see the help of MS Access...

:)
Sep 20 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13499
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a compatibe Bitmap or DC it comes back with an error as win32ui: CreateCompatibleDC failed
1
2247
by: David B | last post by:
I have a form with 2 listboxes side by side. By double clicking a record in the first lb that record appears in the 2nd lb by way of a table. The record id field in the table is set to no duplicates to prevent the same record being sent twice. If a duplicate is selected the access error box "Can not append all records in append query etc etc" tend s to confuse users. How to I trap this error and put up a message box which the user can...
1
4196
by: Henry Stockbridge | last post by:
Hi, I have created a UserLog table that captures the date/time the User logs in to the database (via AutoExec macro.) The UserLog also captures the date/time the User logs out (form event.) I'd like to write one record to capture this, but instead can only capture this in two separate records: UserName Computer LoginDateTime LogOutDateTime Version
3
6883
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records from rsSource into rsDest - if it finds a key violation then it deletes the current record from rsDest and adds the new record from rsSource. This works perfectly - but only for the first found duplicate record, it brings up the error
2
1409
by: PC Datasheet | last post by:
I have a table named MyTableBlank that contains no records. My intent is to make a copy of this table, name the copy MyTable, append some records to MyTable and import MyTable into an external database. I use the TransferDatabase function to import MyTable into an external database. I need MyTable to be in both the current database and the external database. Prior to making the copy, I have code that checks to see if a table named MyTable...
0
2145
ak1dnar
by: ak1dnar | last post by:
There is a Error getting while i am entering records using this jsp file. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <%@ include file="../Connections/conn.jsp" %> <% // *** Edit Operations: declare variables // set the form action variable String MM_editAction = request.getRequestURI(); if (request.getQueryString() != null && request.getQueryString().length() > 0) {
4
7599
by: franc sutherland | last post by:
Hello, I am using Access 2003. I am having trouble trapping the "can't append all the records in the append query" error message when appending data to a query from a table which is linked to an excel spreadsheet. There are two tables. One is a list of general contacts, and the other is a list of clubs. The clubs contain members who are within the contacts table. When I add a list of new club members from the
2
2590
by: kkshansid | last post by:
this is my search page on which i am getting two parameters from previous page but the problem is that as soon as i click any other next pages my sql query fails as it doesnt get these two parameters kindly help <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title>
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.