Import / Query Problem

Apr 24, 2008

Hello!

I originally posted this in the general forum because I did not know where to begin with my problem.

(Link: http://www.access-programmers.co.uk/forums/showthread.php?t=148131 )

According to the person who responded, I need to create an update query. How do I do that?

Thanks!

View Replies


ADVERTISEMENT

Modules & VBA :: Import Csv Files And Rename Them After Import Into (imported) And (failed)

Jul 17, 2015

I have the following piece of code for importing the .csv files from a selected folder and then renaming them into 'imported & filename' if succesful and 'failed & filename' if import failes for whatever reason (bad formating, etc.).

The problem is that the first time it encounters a 'bad' file after another, instead of going again to the Error handler, the command

Code:
DoCmd.TransferText acImportDelim, , "Activitate", filename, True

gives me the default MS Access error, namely 2391. I would like it to go the the Error_handler again ang follow the course of actions and rename the files into 'failed' and 'imported'.

Here's the code:

Sub ImportActivitate()
Dim strFile As String 'Filename's
Dim strFileList() As String ' File Array
Dim intFile As Integer 'Number of files
Dim filename As String, sFullName As String, sFilename As String
DoCmd.SetWarnings False

[code]....

Also, how can I make the routine stop cycling through the files after I renamed them all?

View 3 Replies View Related

General :: Large Table Import / Way To Import Tables To Access

Sep 17, 2013

I want to make a database of diseases (need to learn them for school and would like a serchable database on my smart phone for future reference).
Unfortunately spent a lot of time making hundreds of pages of word tables before i realized a database would be better. See attached image or pdf. Is there a way to import the tables to Access?

I need to preserve the hierarchic info in the nested bullet point lists. E.g. under treatment i might have a point called Acute treatment, with sub-levels, Step 1, Step 2, etc. with their own sub-levels. I need to maintain this relational hierarchic info.

View 3 Replies View Related

Import SQL Query From File

Apr 27, 2007

Hi.

I create SQL queries on my wesite and I put them in files for the user (.sql, but any file type would be possible). I would like them to easily import them in their MS Access.

I can copy the SQL-line and paste it in Acces' Design View -> Query menu -> SQL Specific -> Select Union. But I think that is too complicated. I would just like to import them from a file to make it easier for the user of my site.

Is that possible?

View 3 Replies View Related

Reports :: Import Only One Record From Query

Jun 5, 2013

I have a report already made but is it possible to import only one record from a query?

View 1 Replies View Related

Queries :: Prepare Csv For Access Table Import Using Select Query

Oct 26, 2014

I have generated two queries called "qry_GetWellName_GetAPI" and "qry_GetWellProduction" that extracts all the data I need from a csv to make two tables.

My issue is that I can not gather all the production data into a query formatted properly for a make table query that contains production history by month / api number.

Ideally the data would be placed in a table called tblProductionHistory with the following unique table index --> [api_fk] [data date]. The api_fk would link to the table that was created by extracting well names using qry_GetWellName_GetAPI.

tblProductionHistory field structure I am trying to achieve:

[api_fk]--[data date]--[oil rate]--[gas rate]--[water rate]--[days produced]--[cumulative oil]--[cumulative gas]

Currently the qry_GetWellProduction shows each well name and the year it had production as a separate record from the month names and the month's production values. I need to consolidate the data so each record can be matched to the unique table index.

Is there a sub query I need to use to manufacture a data date for each month that includes the year and last day of that month for that year? Also would I need a separate sub query to match each month's production to the api number?

View 1 Replies View Related

Calculated Field In Access Query Contributes To Crashing Excel Table Upon Import

Oct 24, 2012

I have a simple calculated field (As "Ratio") that is readable in Access 2010 query, but crashes in Excel upon importing/running the query in an .xlsx table.

ERROR MESSAGE in EXCEL: "The query did not run, or the database table could not be opened...check database server..contact your database administrator.."

I am simply taking the cost amounts of each project record (shown as "Record Cost") and dividing it by the "Total Cost" of that project to render "Ratio".

The Total Cost is retrieved from another table.

Testing scenarios:
If we exclude Ratio, the whole query import just fine.
If we filter the query to one project (i.e. "Project A") the ratio field imports fine.

However, the whole unfiltered query does not with the ratio!

Other testing scenarios:

If we use a constant for the denominator AS "1" in Ratio (i.e. recordcost/1) the whole unfiltered query and ratio field imports fine.

If we use a constant for the numerator AS "1" in Ratio (i.e. 1/totalcost) the whole unfiltered query upon import crashes in Excel.

This is a mock example of the dataset, the actual query has 50K+ records:

Project Service Date Record Cost Total Cost Ratio
A Welding 1/1/2012 $100 $120 83%
A Plumbing 2/1/2012 $20 $120 17%
B Welding 1/1/2012 $50 $75 67%
B Plumbing 2/1/2012 $25 $75 33%
C Welding 1/1/2012 $40 $61 66%
C Plumbing 2/1/2012 $21 $61 34%

View 5 Replies View Related

Import

Oct 6, 2005

Hi all,

At the moment i am trying to produce a button which my users can click on to import some data from Excell to Access.

When i just go through it manually, ie file> import etc, the table fom Excel appears in access perfectly, but when i try using my button it brings up the following message:

Field 'F1' doesn't exist in the destination table 'Sheet2'.

The button runs off a macro. This is what i have for each option:

Action:TransferSpreadsheet

Transfer type: Import
Spreadsheet type:Microsoft Excel 3
Table name:Sheet2
File name:the file location
Has filed names:No
Range:

I would be grateful if anyone could help and let me know where i am going wrong.

Thankyou

View 3 Replies View Related

XML Import

Feb 21, 2008

Can someone give me a general guide to this

i have a file of invoices

each invoice has a header, and multiple lines

if you import using external file/import access just constructs tables of each individual xml tag, populated with the various values, not linked in any way

how do you get an invoice table, and invoice line table, etc, populated with appropriate data.

View 13 Replies View Related

Xml Import

Sep 20, 2007

I guess this will be my last plea for help as to why an xml file will import the data into access 2003 (on my home PC) but not import the data, only the fields, on my work PC.

In both importings I'm indicating to indicate data and structure. Could it be the difference between versions? Perhaps a restriction at the end of my work environment?

Help....

View 6 Replies View Related

How To Import

Apr 7, 2008

Hello Friends,

Please I need a help to import data from a table in another database exist on another computer via Internet.

Thank you

View 2 Replies View Related

Import 1NF To 2NF Db

Aug 14, 2006

Hello,

I am not sure if this topic has been coverd in access-programmers forum but I'll ask any way.

I have thousands of records stored in excel (1NF). I have a access db to improve the need to have so many records duplicated.

Is their a way, via an action query (if so what one - update, append, cross tab etc) or another method to import the records and put them into related table.

For example, the current 1NF record columns are as follows >

typeOrgcntPrecntForcntIntcntSurjobTitIdcntPMCcntLandcntMobilecntFaxcntEmailcntBCcntAcccntConfcntLescntTBcntTRcntBanqcntMisccntNotesChaseorgNameorgAddrorgAddr2orgCityorgCountyorgPoCodeorgLandlineorgFaxorgEmailorgURLclientOfappVenueappD8appTypescrNameorgNotes

In my DB i have seperated the above into many table.

Here is a list of new tables with colums >

Table Contact -

cntID orgID cntPre cntFor cntIntcntSurjobTitIdcntPMCcntLandcntMobilecntFaxcntEmailcntBCcntAcccntConfcntLescntTBcntTRcntBanqcntMisccntNotes scrName

Table Organisation -

orgID typeOrg orgNameorgAddrorgAddr2orgCityorgCountyorgPoCodeorgLandlineorgFaxorgEmailorgURLclientOf orgNotes

Table Appointments -

AppID cntID appVenueappD8appType


Of course as organisation is the parent table, their is no problem doing a simple cut and paste, but i can work out how to put related records in a related table. Can you help?

View 1 Replies View Related

Import From Another Database

Aug 15, 2005

Not sure where to post this question, so I put it in the general section,

I have an old db that i would like to import into a new be db of a newer version i wrote of this db. Is there any way something like an append query will add the records from one database to another?

or do i have to import then append then delete?

I have read several posts on this forum reference importing but all of them are from excel spreadsheets. Can this even be done??

Ricky

View 4 Replies View Related

Import From Filemaker

Jan 22, 2006

I have been asked to recreate an existing database which was done in FileMaker into Access.
Rather than re-enter all the data which is in there, can I just import it into Access?
I tried exporting the FileMaker data into Lotus 123 format and then inporting it to Access that way. Filemaker has a bad habit of not exporting duplicate entries. I need this data as well.
Any suggestions would be greatly appreciated.

View 1 Replies View Related

Import Menu Bar

Mar 23, 2006

Hi,

I created my own menu bar in one MS Access file, let's say db1.mdb.

Can I import it to another database file (let's say db2.mdb)?

Thanks.

View 1 Replies View Related

Import Help Needed

Jan 1, 2007

Hi

I have got a Microsoft Access Database table with a few hundered records, I have got a excel or csv file with the same table but its got changes, deleted records and new records added.

What I want to do is replace the info in the access table with the new data that I want to import in. But I don't want duplicates and I want it to add, delete, modify records.

I know in MySQL you can use a Replace Query that does what I want. But the database I am working on is Microsoft Access.

Is their a solution in MS Access that I can tell it to point to a Excel Spreadsheet, or csv file and replace existing records with the changes, delete and add.

Matthew

View 4 Replies View Related

Import SQL Via Code

Feb 21, 2007

Hi.
I have a db, where the main table is linked via an ODBC connection to a SQL server db.
Want I would like to do is, either by code or a macro, import the information from the ODBC link , rather than "File", "Get External Data" etc etc.
This way, the code or macro would run everytime the db is closed, and the information is stored in the db as a table..... just as a backup

I have tried the various "Transfer Database" with macros, but nothing seems to work

I don't know whether this would have any bearing on the answer but I do not have write permisisons on the SQL server, and it does not have a primary key.......as far as I am aware.

Many Thanks.
Frank.

View 2 Replies View Related

Can Access Import CSV?

Mar 8, 2007

Hi,
I'm using Access 2000.

I use a feedback form on my website to receive my customer details by email.
Currently I print out the data and type it into my form.

I can alter my feedback form so the data in the email is seperated by comma's.

Is there anyway I could import the comma seperated values directly into my database rather than typing each one in by hand?

Or could anyone recommend a different method of transferring the data from the email please?

Any help would be greatly appreciated!

Many, many, many thanks!

View 1 Replies View Related

Import From Another Access Db

Dec 4, 2007

I need to import a form to an access 2007 database (from another access
2007 database) but on the External Data menu group, under the Import section,
the Access option is greyed out (all other options are available).

I performed this same function yesterday and the Access option wasn't greyed
out.

I've also opened up yesterday's backup of the DB and the Access option is
greyed out in that too...

Any help would be appreciated.

View 2 Replies View Related

Help With Date Import

Oct 27, 2004

I am having to import data from a txt file on a daily basis. The date format in one of the fields is:30-Sep-2004 09:40:57 PM EDT. I want this to be in a short date format. I don't care about the time at all. If I try to import the data with this field set to Date/Time (regardless of format) it simply deletes the data in that field and goes to the next. If I import it as a Text field, it brings the date in as above.

Once the data is imported to the table, I can change the property of the field to Date/Time --> Short Date and it does the conversion. Is there a way to do this conversion automagically? I can't quite get any of the queries to work.

TIA for the help.

View 4 Replies View Related

Import Data

Mar 9, 2005

Good Afternoon

I'm trying to import some data from an excel sheet to a table in my database. The import wizard won't allow me to import the data into an existing table, only into a new one which is a nuisance. The data formats are the same. Any idea's what might me wrong Please.

Thanks

VC

View 3 Replies View Related

Table Import Help

May 25, 2005

I have lots of CSV files that are per day and are as follows:

File 1:

Username Time
Bob 2
Joe 6

File 2:
Username Time
Joe 8
Sue 6

Essentially what I want to do is import each file into one table where if the username is not in the database it creates it, if its already in there a new column is created with the date. I dont mind creating multiple tables for each date and merging them.

So after those two files above were imported my table would look like this:

Username Time1 Time2
Bob 2 0
Joe 6 8
Sue 0 6

There are not many individual dates for that to be a problem, but there are over 5k different usernames in each file so I can't eyeball anything lol.

I am fairly new to access, but I am seasoned in MYSQL and Oracle. I've done some light searching on these forums and have not really come accross anything I need.

Thanks!

View 13 Replies View Related

Another Import DBF Question

Oct 18, 2005

I've searched and searched but can seem to come up with an answer for my particular problem. I have a dbf table (well two actually but lets keep this simple) that are in a different location every day (folder name based on date). I came up with the following code but i get "Access can not find the database you requested. check file name". I've used this in the past with not problems (a simpler version anyway). Since I've used it in the past, I've changed computers, is there a setting problem I'm missing??

Here's the code:

Private Sub ImportInvpertDBF_Click()
On Error GoTo Err_ImportInvertDBF_Click


DoCmd.SetWarnings False
path = ahtCommonFileOpenSave
DoCmd.TransferDatabase acImport, "dBase 5.0", path, acTable, , "tmp_strInverts", False
DoCmd.OpenQuery "qryAppendInvertTbl", acViewNormal, acEdit
DoCmd.DeleteObject acTable, "tmp_strInverts"
DoCmd.SetWarnings True
MsgBox "Import Successful", vbInformation, "Import Table"


ImportInvertDBF_Click:
Exit Sub

Err_ImportInvertDBF_Click:
MsgBox Err.Description
Resume ImportInvertDBF_Click

End Sub

I have the module for Path=ahtCommonOpenSave working in other imports fine so I figure that's not my problem.

The dbf files are comming from a field collection crew daily and I just want them to have a one click option to find the dbf's and import them into the DB.

Any help?

Thanks Folks!

Eric

View 1 Replies View Related

Import Data Help

Feb 21, 2006

I'm importing data from a spreadsheet to a new table in access. After the import, there are 10 empty records added at the end of the table. I think this has happened before but I don't remember why. Any ideas? Thanks!:confused:

View 1 Replies View Related

Import Name ONLY Of A (.tif) File

May 8, 2006

I have MANY scanned image (.tif) files in multiple folders based on certain criteria. I need to find a way to import only the names of these (.tif) files into a table or even into an excel spreadsheet. Since they are scanned images you can not do a simple copy / paste.

I would appreciate if anyone has any ideas how this could be mastered

View 4 Replies View Related

Import Issue

Sep 1, 2006

Hi,

I've been looking around for an answer to this one but haven't really found one.

I am importing data from an excel spreadsheet which is working fine but the primary key field i am not importing.
The last number was 1020 but when i imported the new data the next number is now 71765441 ?????
Where did that come from?
And can i prevent this or will it matter?

Many thanks in advance

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved