473,395 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

capture error message: can't append all the records

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 4336
PEB
1,418 Expert 1GB
Hi,

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

:)
Sep 19 '06 #2
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.Count
FoundFile_str = .Foundfiles(i)
DoCmd.TransferText acImportFixed, "SAP_Incoming_spec", "Tmp_InBound_SAP", 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_ImportTmpToInbound_qry"
Sep 19 '06 #3
PEB
1,418 Expert 1GB
So,

In this case you can desactivate the error message with

docmd.setwarnings false

DoCmd.TransferText acImportFixed, "SAP_Incoming_spec", "Tmp_InBound_SAP",

docmd.setwarnings 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
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...
1
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...
1
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...
3
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...
2
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...
0
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...
4
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.