Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 14th, 2006, 07:11 AM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default Data from excel to access

Is it possible to bring data from excel into access only when I want!
I have linked a excel sheet into access but it's getting slowly the base!
I think if I have opened the excel data into access only when I really want it wouldn't be slow!
Maybe with a button I could see the data only when I want!

I would be grateful if you could help me!

Reply With Quote
  #2 (permalink)  
Old June 14th, 2006, 08:04 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Yes.

I would suggest TransferSpreadsheet and put it in a table when needed. That way you only squirt the back end when you want the data, and never create a persistent connection. This means that the functions would be:

DoCmd.OpenQuery (delete query) to remove current data from table.
DoCmd.TransferSpreadsheet (Or database?) to pull data from the spreadsheet.

Did this help?


mmcdonal
Reply With Quote
  #3 (permalink)  
Old June 14th, 2006, 08:34 AM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks mmcdonal, but the thing it's more complicated!
I've linked the spreddsheet cause I want to be on real time!
I'm taking two fields(with numbers)-(from the linked sheet), continuasly I'm making a query where I sum the two fields.
And in one form xxx, I've brought a subform yyy (the query), to show me the results!
First problem: I can't when I'm opening the real .xls to open the form xxx
Second problem: I can't see the results of the form xxx on the second pc (there two pc connected), when it's already opened in the first pc!

This I'm really trying is in both computer to see the query of the form xxx at the same time, moreover don't getting too late!

I didn't understand where should I type the
DoCmd.OpenQuery
DoCmd.TransferSpreadsheet

and if I won't link the .xls table how could I brought the data of it?

Thank you once again!



Reply With Quote
  #4 (permalink)  
Old June 14th, 2006, 09:05 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Well you have two contradictory issues here.

IF when you open the form you can't open the spreadsheet, then why have the connection in real time? If the spreadsheet will remain closed when you access the data anyway, why not just import it?

Anyway, on the other questions:

You need to create a table that can accept the data from the spreadsheet.
Then when you pull data from the spreadsheet, you need to have a delete query that runs first to get rid of any old data in the table.
Then transfer in the data from the spreadsheet.

So if you created a delete query called "qryDELETEOldData" your code would look something like:

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDELETEOldData"
DoCmd.TransferSpreadsheet (look up syntax)
DoCmd.SetWarnings True
DoCmd.OpenForm "frmYourFormXXX", etc



mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data transfer from Access to Excel swaroop Access VBA 2 June 1st, 2007 10:30 AM
Access data to Excel Template Hamerw Access VBA 1 November 22nd, 2006 12:38 AM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM
Moving data from Excel to Access ChrisWalsh Excel VBA 1 April 14th, 2005 12:13 PM
retrieving data in excel from access. yesilkalem Access 1 May 25th, 2004 04:19 PM



All times are GMT -4. The time now is 10:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.