C
CLR
Hi All............
I have a macro that I recorded and it works fine. My problem is that I
would like for a pop-up to appear when it starts and accept my typed input
to replace the string 'A01X02601-02' with whatever new string I want to type
in........is that a do-able thing?
Here's the macro:
Sub QueryTest()
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=FS - MSS-Fourth Shift;ServerName=FS.1583;ServerDSN=FS -
MSS-Fourth Shift;UID=clr;PWD=chuck;ArrayFetchOn=1;ArrayBufferSize=8" _
), Array(";DBQ=M:\Mfgsys\System;CODEPAGE=1252;")),
Destination:=Range("A1"))
.CommandText = Array( _
"SELECT ITEM_MULTILEVELBILL.END_ITEM, ITEM_MULTILEVELBILL.PARENT,
ITEM_MULTILEVELBILL.PARNT_DESC, ITEM_MULTILEVELBILL.REV,
ITEM_MULTILEVELBILL.MB, ITEM_MULTILEVELBILL.DRWG,
ITEM_MULTILEVELBILL.COMPONEN" _
, _
"T, ITEM_MULTILEVELBILL.COMP_DESC, ITEM_MULTILEVELBILL.COMP_MB,
ITEM_MULTILEVELBILL.IN_REV, ITEM_MULTILEVELBILL.OUT_REV" & Chr(13) & "" &
Chr(10) & "FROM ITEM_MULTILEVELBILL ITEM_MULTILEVELBILL" & Chr(13) & "" &
Chr(10) & "WHERE (ITEM_MULTILEVELBILL.END_ITE" _
, "M='A01X02601-02')" & Chr(13) & "" & Chr(10) & "ORDER BY
ITEM_MULTILEVELBILL.COMPONENT")
.Name = "Query from FS - MSS-Fourth Shift_1"
.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
TIA
Vaya con Dios,
Chuck, CABGx3
I have a macro that I recorded and it works fine. My problem is that I
would like for a pop-up to appear when it starts and accept my typed input
to replace the string 'A01X02601-02' with whatever new string I want to type
in........is that a do-able thing?
Here's the macro:
Sub QueryTest()
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=FS - MSS-Fourth Shift;ServerName=FS.1583;ServerDSN=FS -
MSS-Fourth Shift;UID=clr;PWD=chuck;ArrayFetchOn=1;ArrayBufferSize=8" _
), Array(";DBQ=M:\Mfgsys\System;CODEPAGE=1252;")),
Destination:=Range("A1"))
.CommandText = Array( _
"SELECT ITEM_MULTILEVELBILL.END_ITEM, ITEM_MULTILEVELBILL.PARENT,
ITEM_MULTILEVELBILL.PARNT_DESC, ITEM_MULTILEVELBILL.REV,
ITEM_MULTILEVELBILL.MB, ITEM_MULTILEVELBILL.DRWG,
ITEM_MULTILEVELBILL.COMPONEN" _
, _
"T, ITEM_MULTILEVELBILL.COMP_DESC, ITEM_MULTILEVELBILL.COMP_MB,
ITEM_MULTILEVELBILL.IN_REV, ITEM_MULTILEVELBILL.OUT_REV" & Chr(13) & "" &
Chr(10) & "FROM ITEM_MULTILEVELBILL ITEM_MULTILEVELBILL" & Chr(13) & "" &
Chr(10) & "WHERE (ITEM_MULTILEVELBILL.END_ITE" _
, "M='A01X02601-02')" & Chr(13) & "" & Chr(10) & "ORDER BY
ITEM_MULTILEVELBILL.COMPONENT")
.Name = "Query from FS - MSS-Fourth Shift_1"
.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
TIA
Vaya con Dios,
Chuck, CABGx3