Input Box Help

J

Jims

I am trying to build a user imput box that will ask the user for the table
name within the data base that I have selected from the code below. I need
the user to be able to view the tables in the database and then either select
it or enter into the input box. the defualt path and database will always be
the same. the table names will change.

Sub GetUsageReport()

With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User
ID=Admin;Data Source=C:\Scc\db\db1.mdb;Mode=Share Deny Write;Extended
Properti" _
, _
"es="""";Jet OLEDB:System database="""";Jet OLEDB:Registry
Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet
OLEDB:D" _
, _
"atabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=" _
, _
""""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLED" _
, "B:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"),
Destination:= _
Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("UsageReport1")
.Name = "db1"
.SourceDataFile = "C:\Scc\db\db1.mdb"
.Refresh BackgroundQuery:=False
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top