ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Query Help (https://www.excelbanter.com/excel-programming/409697-query-help.html)

Leanne

Query Help
 
I have built a query and have the following code on a command button to
refresh the query.
Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

When I run this it goes through the motions and asks for the parameters set
and then i get the Refresh complete however I am not getting any infromation
returned. When I run the report independantly of this code/button I do get
the information.

Can anyone help me identify what is going wrong please.

Leanne

Query Help
 
Never mind! I solved it myself! There is a first time for everything!

"Leanne" wrote:

I have built a query and have the following code on a command button to
refresh the query.
Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

When I run this it goes through the motions and asks for the parameters set
and then i get the Refresh complete however I am not getting any infromation
returned. When I run the report independantly of this code/button I do get
the information.

Can anyone help me identify what is going wrong please.



All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com