Inserting/updating Data From A Csv File

Dec 8, 2005

Hi

I have recently had to add a new field to a FIRM table in our contact database, Firm.PhoneNumber (please don't ask why it wasn't there before!). The primary key in this table is Firm.FirmID.

I have a list available to me in .csv format that contains all the phone numbers I need, it has two 'columns', labelled FirmID and PhoneNumber.

The process is surely a simple one, I just need to update/copy/insert the corresponding phone numbers from the csv file into the Firm.PhoneNumber field. I won't bore you with what I've attempted thus far but could someone please provide me with the quickest possbile method for achieving this task?

Many thanks

Stuck21

View Replies


ADVERTISEMENT

Inserting AND Updating Entire Table

Sep 19, 2004

Hello,

I am currently working with a database that has a table called "Students." I need to import records from a textfile that has a bunch of records, some new, some existing records but updated. I got them to import into a table used for imports (called "Import Table") and I was able to run a query to append the records if they were not already existing, but how do I get a Query to do both new inserts and updating existing records with new info from the imported data?

i.e.

Bob is in the database already, but needs to update his records. His updated record is in a textfile which is now in the "Import Table". But in that same textfile/table, there are some new people that need to be added.

Thanks!!!

View 2 Replies View Related

Queries :: Inserting And Updating Based ID In Main Table

Sep 29, 2013

I have add my two tables

Main table calls Attack
Sub table calls Research

the main table attack is linked with sub table Research by Attack.ID and Research.attack_id from form automatically

The sub table Research have more than one record which is linked into the main table Example:

How can I get the data which is marked in blue into record 24 and the data marked in Red into row 23

using Unite_Equal column?

View 3 Replies View Related

Problems Inserting Data

Apr 12, 2006

I've searched all over and can't seem to figure out an answer to this, so I'm putting it in front of the experts (who'll probably have a simple answer in about 10 seconds).

I'm doing a survey that has both radio buttons and check boxes. If it were all radio, it'd be easy, but the check boxes are making it complicated for me.

Here's the insertion code I'm working with:
Code:SurveyInsert2 = "INSERT INTO data (answerID, surveyID) VALUES ('" & Request.Form(fld) & "', '" & currentsurvey & "')"oSurveyAdd.open SurveyInsert2, "dsn=survey" For Each fld in Request.FormoSurveyAdd.Execute(SurveyInsert2) Next
which is spewing the answer:
Code:Request object error 'ASP 0102 : 80004005'Expecting string input/survey_process.asp, line 44The function expects a string as input.

Help! What am I doing wrong?

View 11 Replies View Related

Inserting Data Into Two Tables - Urgent

Nov 7, 2006

Hi, this dilemma really has me in a bind - say I have table1 and table2, when I enter data/update table1, I need to also enter the same data into table2. I know this sounds royally weird, but if there is a way to do this I would appreciate any and all help asap!

Thanks in advance.

View 3 Replies View Related

Inserting Data From Form Into Table

Nov 2, 2005

i have a problem adding the data from the fiels on the form into a table. I know you can just click on the navigation arrows and it will save the record but i want to use a submit button as this is more user-friendly and suitable for the work i'm doing.

I have attached the database... the form that needs the code for submit button is 'frmNew_JobStatus' and the table i'm trying to insert the data into is 'tblJobStatus'

can anybody have a look at what i've done so far and suggest how i can fix this... sample code would be very usefull as i'm not an access expert.

thank you all

View 1 Replies View Related

Inserting Data From One Table To Another Through Form

Aug 25, 2004

I want to design a form , please note I have beginners information regarding Access,
I have 2 tables , 1 table has Project No, Document No, DEpt NO. with all the information

There is another table-2 with Project No, Document No. and Resourcrce. There is not data
in this table

What I want to do is , I want to create a form where in I select the Project No. and
Dept No. When I select these items the form should list me the data in Table 1 for that
Project no and DEpt No. , after this data is listed , I will add the REsource data
and all this data has to be stored in table-2. I hope some one will be able to guide me on
how to do this.

View 6 Replies View Related

Inserting Data Into A Field From A Query.

Oct 3, 2004

Hi,
Am currently working on a project for AS IT. one problem that i need to come across is trying to see data in a field that comes from a query?!?! Confused?! so am i!

When i first open the form, a paremeter query appears asking me to insert a surname (which i have created) when i insert the surname....and click on the drop down button, it gives me three values...ForeName, Surname and class

When clicking on the pupils name, i want the Class of the student to be inserted into the Class Field!

Can anybody help?
Danbwest

View 1 Replies View Related

Warning Messege While Inserting Data

Feb 6, 2007

hi

when i am inserting data into table useing insert into statment i am getting one warning "do u want to append or not". what i can do to overcome this messeage.

View 2 Replies View Related

Forms :: Inserting Data In Table

Nov 9, 2013

I am new to Access and i am designing a payroll system for my company. I have created a Table with

EMP Id, Name, Basic Pay, Total Working Days, Actual Work Days, Earned Salary, OT days, OT Hrs, OT Pay..

Now i have created a form with all the above fields.and calculated the earned salary from the control source where Earned Salary= Basic pay / Total Working Days*Actual Work Days and OT Pay =[Basic Pay/Total Work Days/8]*150%*OT Hrs.

Now my problem is i am not able to populate the fields in the table.

View 4 Replies View Related

Inserting Data And Retrieving Fields

Aug 25, 2015

i have the below code which inserts data and then i want to retrieve the value in the first two columns but firstly it says "you must use dbseechanges" but i have put this into the code you may see below,

Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
dim sSQL as string

[code]....

View 10 Replies View Related

Inserting Data From Excell To Access Table

Mar 23, 2005

I am currently using access 97.

I am trying to read from an excel file that has the same format but changes data every day due to reports that I run from a different program. I just export them to this excel file called test.xls

What I want to do is import this data from the excel file and insert it into existing data in my table. I need to this every day.

Currently I cannot get the data to append. I can only insert the data once and cannot get it to append. I tried using macros, but think it would be better to use VB.

Any help you could provide would be great.

Thank You

View 1 Replies View Related

Inserting Data From Two Tables Into Another Table Using A Form

Oct 22, 2007

I am new to access (using Access 2003) and am having trouble working with forms. Here's what I want my form to do:

-Use a combo box to select a specific system
-Given the selected system, pull up ID numbers and descriptions (in separate text boxes) from two separate tables corresponding to that one system
-Navigate through those ID numbers/descriptions from each table independently to find ones that match
-Store the ID numbers of the ones that match into another linking table

The biggest problem right now is being able to navigate through the different table ID numbers/descriptions and add both ID numbers to a row in a different table. I've tried using a combo box with the INSERT INTO statement into the code builder, but I keep getting syntax errors.

Does anyone have any suggestions on a better way to do this?

Thanks!

View 3 Replies View Related

Queries :: Inserting Missing Data In A Table

Jan 10, 2015

How to fix some records in my access table. It is a huge table more than 12k records!

In one of the field there are some data missing. The logic to reconstruct them is easy but I am not sure how to apply it in Access.

I have three columns one is the student ID, Year, term1 and term2

ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003
3311 2004 005 005

In the above example student 1234 has a missing record in year 2004 which supposed to be Term2 in the previous year (i.e. 003) and Term2 supposed to be Term1 value in the following year (i.e. 004). Similarly for student 3311

ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004 003 004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003 004 005
3311 2004 005 005

View 3 Replies View Related

Modules & VBA :: Ms Access Lock Table While Inserting Data

Oct 31, 2014

In a Access 2003 database, I have an "Inscriptions" (subscription) database with a primary key on 2 fields idPersonnel (employee) and idSession. I have made a form so that user can select a session (in a listbox), then one or more employee (another listbox) and suscribe them to that session by using a button, which, on VBA side, first check that there is enough room on the session (defined by "MaxParticipants" field on "Sessions" table, linked to "Inscriptions" table on idSession), then insert data in "Inscriptions" table

This is working fine in a single-user environnement, but fails if 2 people want to join some employees on the same session at the same time, as I have a confirmation message between check and insertion. Therefore 2 users can select employees, get the confirmation message (at this point both are told there is enough room), resulting in having more people than expected joined to the session. Fortuneatly, if both users try to insert the same employee(s) to that table, one will get a duplicate error, but insertion will be made if employees are different.

On another DB engine, such as SQL server, I would use a stored procedure that would lock the table, do the check and the insertion then unlock the table.

But it does not seem to be possible in MS Access. What are the possibilities in MS Access to prevent a session from having more than maximum number of participants ?

View 1 Replies View Related

Access File Became Very Large During Updating

Mar 16, 2007

I am writing a vba procedure to updating some records in another Access database.

rsAccess.Open "SELECT * FROM AI_Table",conAccess, adOpenForwardOnly, adLockPessimistic

rsAccess!OCRExist = "Exist"
rsAccess.Update

it has about 3 millions of records in that AI_Table. In the procedure, I perform some calculation and put the result into a TEXT(50) field in the AI_TABLE. As it was updating the records, I could see the size of the Access database file (the one contained AI_Table) grew very quickly, almost 1 MB/sec. I am pretty sure I am not adding that much data. If I stop the procedure and packed the database, it shrunk a lot.

I am just wondering if there is anything wrong with the way I am locking or updating the records.

Thanks,
pggsB

View 2 Replies View Related

MDE File, Updating Tables Within Via Query

Jan 27, 2008

Have an MDE file in our equipment, it's a language data base
one of the languages isn't fully translated so I did a query to
pull out those records that equaled the English field which
brought the 1800 lines down to 218 to go over and edit.

BUT

What I am worried about, well our Software Engineers are nervous
about is my trying to udate those records via an update query
and then putting the MDE back into the machine's computer.

Is there something that I should be careful about while doing this?
I know that I shouldn't try to repair and compact as MDE just
goes bye bye when that is done, changes into an MDB file.

Appreciate any thoughts on the above,
G2

View 7 Replies View Related

Forms :: Inserting Data From Multi Rows Into Separate Columns

Oct 17, 2013

I have a database with a form that has 3 fields in a subform. I need to paste there data from multi rows. Now I have to do this column by column and paying attention that I select them correctly. Is there a way to directly insert the data by selecting only 1 field and have the data directly there as it would in excel?

Now we use excel as a "between" road to paste it there and then copy it from excel and paste it into access.

View 9 Replies View Related

Modules & VBA :: Inserting Field Value When Adding Record Using Data Entry Form?

Dec 14, 2014

I have a form for entry and some fields are computed or result of a query from another table. I have a function that looks up a value from another table like so

************************************************** ********
Public Function GetTargetType() As Variant
GetTargetType = DLookup("type", "tblFormulations", "[tblFormulations!formulation]=Forms![frmNmsConsumptionEntry]![formulation]")
End Function
************************************************** ********

Which works fine when I test in the immediate window.Then I have this form event. This however does not insert this value when I am adding records using my continuous form.

************************************************** ********
Private Sub Form_BeforeInsert(Cancel As Integer)
Me!target_group = GetTargetType()
'Forms!frmNmsConsumptionEntry!target_group = GetTargetType()
'[tblNmsConsumption.target_group] = GetTargetType()
End Sub
************************************************** ********

making sure I can insert this value once retrieved.

View 7 Replies View Related

Forms :: Method Or Data Member Not Found When Inserting Values To A Table

May 13, 2013

I am getting method of data member not found for the following code when inserting values to a table. Form has three frames. Add/Insert is on OnClick Event.

MsgBox "First Value, " & Me.txt_FSNo
CurrentDb.Execute "INSERT INTO BackchargeLog (BC_FSNo, BC_FContract, BC_FPurchaseOrder, BC_FProjectArea, " & _
" BC_FTitle, BC_FDetailDescription, BC_FSupplierToBeCharged, BC_FSupToBeChargedNumber, BC_FSTBCContactName, BC_FSTBCContactNumber, " & _
" BC_FSTBCContactEmail, BC_FIncidentReportedDate, BC_FInitiatedDate, BC_FEstimateAvailable,

[Code] .....

View 7 Replies View Related

Modules & VBA :: Updating Records Based On File Location

Mar 3, 2015

I have created a database that tracks the locations of all the faxes we receive in a day. We have a dedicated employee that enters them into the database as well as who they are assigned to and other pertinent information. At the end of the day, I monitor the network folders where the faxes are saved to change the status of the fax in the database to done, still needs processing, or awaiting approval. Is there any way that I could set up some VBA that would automatically update the status column for the record based on the location of the file? The file name is recorded in the database so then if it sees that that file is in the end folder it could automatically update the status to finished.

The response I got on another forum is as follows:

-The impression I'm getting is that you've got a database of information over here.
-And it lists the file name, but not location.
-And then you have a physical folder structure with the fax files in it.
-And there are folders for done, awaiting approval, or processing.
-So what you're looking for is something to read those folders and update the status column based on which folder it is in?
-So at the start of the day we have:

New
-Fax1.tiff
-Fax2.tiff
-Fax3.tiff
-Fax4.tiff
Finished
-
In progress
-

And at the end of the day the folders look like this:
New
-Fax1.tiff
Finished
-Fax3.tiff
-Fax4.tiff
In progress
-Fax2.tiff

And you want your code to browse those folders, and update the status of each filename based on it's folder?If the filenames are unique, you can just use VBA to open the folder, create an array of the files and then set the status. Create two separate functions, one for in progress, one for completed and call them one after the other. There'd be no need to check the current status, but you could store the wrong status if a file is duplicated, or a filename repeated.

View 3 Replies View Related

Modules & VBA :: Copying File To Specified Folder And Updating Records With New Location?

Jan 28, 2015

I'm currently working on a database to track and inventory documents in my organization similar to a library catalog, but with a digital archive as well. I'll need the ability to "attach" documents to records in the main inventory (though using links instead of storing it in the db) and have the documents live in a centrally accessible location on our shared server.

I will need to have this function work through a few different tables and in a few different iterations, but I'm trying to work on the simplest part first, which is attaching a thumbnail/preview of a given document to the record for that document.

I've got some VBA working well which opens the file picker and copies the file to a directory relative to the DB. It also creates a folder with each employee's ID number if it doesn't exist already (which it gets from the Windows log in) and adds "Copied_" to the front of the file.

Now I'm trying to get the VBA code to interact with the record. Presumably I need to tell the form button I'm using to launch the VBA code to pass the primary key of the record being displayed to VBA. Then, at the end of the VBA code I need to take that value and find the record again from VBA so I can update the MediaThumbnailLink in the original record.

Does this order of operations make sense? If so, how should I go about passing these values back and forth and writing the new link value?

Here's the VBA I'm using so far...

Code:
Option Compare Database
Public Sub GoCopyThumbnail()
Dim fDialog As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Dim LUser As String

[Code] ....

View 2 Replies View Related

General :: Mail Merge Word File (using Data From Access File)

Mar 11, 2014

I often create contract using mail merge. I have an access file that I want to use as data source for word file. But it does not automatically.

Please download the attached file !

If there are 1 customer and 1 property, I do not need to do anything. Conversely, if there are many customers and many properties, I take time to manipulate.

Firstly, I open the word file. I have to copy and paste paragraphs that I want. Highlight of the original paragraphs is blue.

Secondly, I click 'Insert Word Field' -> select 'Next Record'.

In short, I wish to use VBA in access file to automatically perform the steps that I have outlined.

View 3 Replies View Related

General :: Updating Table Data With Data From Preceding Entry?

Jan 5, 2013

My question is this: I have a table where I'm entering employees' hours worked. Basically, it's something like this:

ID WorkerNumberDateworkedTimeStartTimeEnded
121/2/201310:00:00 AM3:00:00 PM
221/3/20132:00:00 AM11:00:00 AM
321/4/201312:15:00 AM11:30:00 AM
421/5/201310:25:00 PM11:00:00 AM
531/2/201311:00:00 AM3:30:00 PM
631/3/201312:00:00 PM10:00:00 PM
731/10/20137:00:00 AM4:00:00 PM

I have a query that (easily) determines how many hours an employee has worked on any given day. What I can't figure out at all, is how to write a query that can figure out how much time an employee had off in between shifts.

Thus far I'm able to run a query that separates this main table into individual workers by their id numbers, but can't figure out how to determine time off between shifts - as the last hour worked one day, and the first hour worked the next day are on two different lines (they are two different table entries).

View 4 Replies View Related

HELP!! Trying To Nomalize Existing Data By Updating Data Into New Fields

Dec 19, 2006

Hello Tech gurus,

I have a database with existing data, that is not normalized, :eek: and all the data is in one field... This what I am dealing with:

As you notice the first row of data in field1 C10A CHOLEST&TRIGLY has 3 spaces to the right the next row ALTORVASTIN has five spaces to the right, the next line LIPITOR has 7 spaces to the right, and so forth, hopefully you get at what I am trying to do, I just looked at the data and it is not showing up in view of the leading spaces, but I am trying to move the data based ONLY on the position of leading spaces, example all data that has 3 leading spaces would go into its own separate column, and all data that has 7 leading spaces would go into a separate column, I have tried to use the left, mid, len functions but I cannot figure out how to move the text and keep it whole only by data position of spaces.

Field1:
C10A CHOLEST&TRIGLY
ATORVASTATIN
LIPITOR
PFIZER
SIMVASTATIN
SIMVASTATIN TEVA
TEVA
M1A ANTIRHEUMATIC N-STEROID
ETODOLAC
ETOPAN
TARO PHARMA
Thanks so much for your help... :confused:

Nana :D

View 10 Replies View Related

Inserting Data From One Form To Another Using A Query In A Form

Sep 6, 2004

HI

I have a form for member details that comes from the member table and I want to
include a button on the form that will remove the member details from the member
table to a member history table and then delete the details from the member table.
When moving the record I also want to include details from another table called 'promotion',
this table is linked to the member table via the member ID (Foriegn Key).

Firstly I want to know if this is possible and if so how I would achieve this. I am having
trouble getting the SQL query to identify the current record that the form is displaying so I can
select additional information and move it into the Member History table.

Any information would be greatly appreciated.

Thanks.

View 2 Replies View Related







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