473,320 Members | 1,991 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,320 software developers and data experts.

Get a value in last record inserted of DoCmd.TransferSpreadsheet

I am importing an excel worksheet into an existing access 2000 table using TransferSpreadsheet. Im using a timestamp field as well in this table. This is going well, however, once the data is imported I need to find the last record imported and pull the value of a field called Code. Then add that value to another table where Code is the Key Value. This is all one continuous operation in the same sub and executing inline directly after
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. DoCmd.TransferSpreadsheet transfertype:=acImport, _
  4.             tablename:="myExistingTable", _
  5.             FileName:=Text4, Hasfieldnames:=True, _
  6.             Range:="myWorksheet!", SpreadsheetType:=5
  7.  
  8.  
  9.  
.

Can anyone point me in the right direction. Ive been struggling for several days and , yes I have searched and searched and experimented and experimented.



Thank you in advance
Sep 16 '10 #1
0 1651

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

Similar topics

4
by: Carlos San Miguel | last post by:
Hi, I'm going to be using Oracle with a customer. I will access Oracle with ODBC. All the tables have an Identity column, this is the ID for the record. I need to know how I can get the value of...
3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
13
by: aleksandra_83 | last post by:
Hello, I have searched all over google groups and internet, but I have not found a solution to this problem that has worked. The solutions I found helped me single out the line that is causing...
3
by: Mark | last post by:
I'm using ASP.Net to accress a database, what I need to do is get the fields out of the very last record in the db. How do I do this? Actually I'm after the primary key, titled 'AdID' it'll tell...
2
by: Tim::.. | last post by:
Simple question... I want to retrive the last record in the database if the value of id is nothing! Can someone please help! Thanks ....CODE...
2
by: Bhujanga | last post by:
I want to scroll through records on an open form and take certain actions based on various criteria. So I want to have a loop such as this: Do While Not Last Record <----- ? ....actions.... ...
2
by: TimSki | last post by:
Hi, In my asp page I am inserting a record in to the sql server 2005 db as follows... OpenDataConnection() oConn.BeginTrans set cm = CreateObject("ADODB.Command") set cm.ActiveConnection =...
8
by: bluemoon9 | last post by:
Does anyone know how to write a code to promt the selection at the last record in the list box?. I have this code below in the "On Click" event, when user click on the code, it close a form, requery...
2
by: Jim in Arizona | last post by:
I forgot what the SQL command was to return the key of the last inserted record. Does anyone happen to know what it is? Thanks, Jim --
5
by: jerelp | last post by:
I have a form with one button the code for that button is On Error Resume Next DoCmd.TransferSpreadsheet acImport, 8, "FuelConsumption NewData", Me.tb_FileName, 1, "sheet2$" On Error Resume...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.