Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default QuerTable query!

Hi,

I have been given an Excel file that gets information from an Access
database using VBA code. Where will I find what the Access database is
called and what fields will it be looking at. The following code is a
snippet and I'd though that somewhere in the code I would have found out
where or what
the QueryTable refers.

ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e

Thanks, Rob



  #2   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default QuerTable query!

Hi Rob:

Help us out here!

"Rob" wrote:

Hi,

I have been given an Excel file that gets information from an Access
database using VBA code. Where will I find what the Access database is
called and what fields will it be looking at. The following code is a
snippet and I'd though that somewhere in the code I would have found out
where or what
the QueryTable refers.

ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e

Thanks, Rob


Well not in that part of the code and if you can't read it and you
done share it, it will remain a secret.
Think about it, you have the code and your asking someone in the group
that does not have the code to tell you what it says.

good Luck
TK

  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default QueryTable query!

TK, The excel file has a command button which has the following code
attached, when the button is clicked it appears to me that a link is made
with an Access database as the range Team is populated with data and a pivot
table that reads from the data is updated. I understand the pivot table
update in the code but can't figure out how the data is extracted from the
Access database, there seems to be no code showing what database is being
used. My question is "how do I change what data is extracted from the
database? Thanks Rob

Private Sub btnPivotUpdate_Click()
On Error GoTo Err_btnPivotUpdate
Application.ScreenUpdating = False

If Sheets("Team").Visible = 0 Then
Sheets("Team").Visible = True
Sheets("Team").Select
ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e
'ActiveSheet.Protect
ActiveWindow.SelectedSheets.Visible = False

Else
Sheets("Team").Select
ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e
ActiveWindow.SelectedSheets.Visible = False

End If
Sheets("Main Menu").Select

Application.ScreenUpdating = True

MsgBox ("Tables have been updated successfully")


Exit_btnPivotUpdate:
Exit Sub

Err_btnPivotUpdate:
MsgBox Err.Description, , "Updating Tables" & ""
Resume Exit_btnPivotUpdate

End Sub


"TK" wrote in message
...
Hi Rob:

Help us out here!

"Rob" wrote:

Hi,

I have been given an Excel file that gets information from an Access
database using VBA code. Where will I find what the Access database is
called and what fields will it be looking at. The following code is a
snippet and I'd though that somewhere in the code I would have found out
where or what
the QueryTable refers.

ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e

Thanks, Rob


Well not in that part of the code and if you can't read it and you
done share it, it will remain a secret.
Think about it, you have the code and your asking someone in the group
that does not have the code to tell you what it says.

good Luck
TK



  #4   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default QueryTable query!

Rob :

Im not gong to be much help here but that is a
refresh procedure not the query.
From your first post I thought it was a DAO or ADO
procedeure but it looks like an MS Query.
I do not have MS Query installed on this computer
but I looked at the help files and they seem pretty
straightforward.
Try (Excel Menu)
Data/Get ExternalData/New DataBase Query
then build your own query

Good Luck

TK

"Rob" wrote:

ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e





  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default QueryTable query!

TK,

Thanks for the pointers, Data/Get ExternalData was the bit I couldn't fathom
out.

Rob
"TK" wrote in message
...
Rob :

I'm not gong to be much help here but that is a
refresh procedure not the query.
From your first post I thought it was a DAO or ADO
procedeure but it looks like an MS Query.
I do not have MS Query installed on this computer
but I looked at the help files and they seem pretty
straightforward.
Try (Excel Menu)
Data/Get ExternalData/New DataBase Query
then build your own query

Good Luck

TK

"Rob" wrote:

ActiveSheet.Range("A1").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
ActiveSheet.PivotTables("PivotTable1").RefreshTabl e







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
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Stop to modify the SQL query manually entered into query ! Olivier Rollet Excel Programming 6 November 3rd 04 08:34 AM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM


All times are GMT +1. The time now is 01:07 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"