Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting Access data


Tom,
Here is one of my procedures in which this problem occurs:

Sub BDF1()
Set Point = Sheets("Extract").Range("AW1")
mycode = Point.Offset(Point.Offset(0, 2) + 1, 0)'code
myyr = Sheets("Extract").Range("AV1") 'year
Sheets("BDFAvailable").Range("a7:e25").ClearConten ts

Const DBLocation = "C:\Documents and Settings\All
Users\CBDApps\Settings\BP\BPLINK.MDB"
Dim db As Database
Dim rs As Recordset

Set db = OpenDatabase(DBLocation)
strselect = "SELECT FUND_ID, LEFT([SCCN],2), PROMOTION_DESC,
TOTAL_AMOUNT, " & _
"AMOUNT_PAID FROM SR2R_FORECAST_HDRS " & _
"WHERE ACCT_GRP_CODE = '" & mycode & "' AND PERF_PERIOD_START
=#7/1/" & myyr & "# AND " & _

"PERF_PERIOD_END <=#6/30/" & myyr + 1 & "# ORDER BY LEFT([SCCN],2)"

Set rs = db.OpenRecordset(strselect)
Sheets("BDFAvailable").Range("a7").CopyFromRecords et rs

rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
end sub

The error occurs when it hits the "Set rs line" above.
It is looking to extract from the D drive, where it used to reside prior
to the new computer exchange. There are no known linkages in the
worksheet itself. I thought I might have had an old ms query in the
workbook, so I copied sheets over and renamed ranges in those
worksheets.

Tom



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting data from one sheet based on data in another - VLookup? des Excel Worksheet Functions 3 February 4th 09 08:27 PM
Can Excel access data from Access?! Al Excel Discussion (Misc queries) 5 April 5th 08 03:52 PM
Need help extracting data.... Bruce Excel Worksheet Functions 4 January 12th 07 05:31 AM
Extracting Data for .Txt Files By Unique Field Data La Excel Discussion (Misc queries) 3 July 17th 06 01:30 PM
Extracting Data Islandzoom Excel Discussion (Misc queries) 0 April 12th 05 11:42 AM


All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"