Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default ms query promt in vba

Hi
I have a macro which calls a lot of ms queries each query has a date prompt
which is the same for each at present I have to enter date for each query .
Is there away to get vba to enter prompt value
I have requested date required at beginning of macro but do not know how to
use this for parameter in query via vba
part of macro as follows
sub macro1()
Sheets("TOTAL UNITS").Select
mydate = InputBox("enter date dd/mm/yy")
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;L:\SYMDATA\TINA\FACTORY\TOTAL UNITS.dqy",
Destination:=Range("A1"))
.Name = "TOTAL UNITS"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
Sheets("MORN OP1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;L:\SYMDATA\TINA\FACTORY\DAY MORN OP1.dqy", _
Destination:=Range("A1"))
.Name = "DAY MORN OP1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
Sheets("LATE OP1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;L:\SYMDATA\TINA\FACTORY\DAY LATE OP1.dqy", _
Destination:=Range("A1"))
.Name = "DAY LATE OP1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
end sub
Thanks
Tina
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
Promt when closing Excel Carit Excel Discussion (Misc queries) 0 March 22nd 06 07:55 AM
Can we Set Default value for the Excel promt(Y/N) SpiderSwamy Excel Programming 2 March 16th 06 05:32 PM
Comment Text Promt Rob Hargreaves[_2_] Excel Programming 1 June 11th 05 09:05 PM
How to promt users to save their work? shirley Excel Programming 1 March 2nd 04 02:43 AM
Printing to Adobe without getting promt for name Danny McCarthy Excel Programming 1 October 29th 03 02:26 PM


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