Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default load data from MS Access

I have a function to retrieve data from Access database to my drop
down list using following code which works.

I tried to add another drop down box on the spreadsheet and load the
data, but it fails.

I just wonder can I fill 2 drop down box on the spreadsheet in the
same function?
If Excel does support for this, where I am missing to fill 2 drop
down box on the spreadsheet?

Youe help is great appreciated,


Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim rcArray As Variant
Dim strSource As String
Dim strSQL As String

strSource = "D:MyDB.mdb"
strSQL = "SELECT tblEmployee.Employee_ID FROM TblEmployee "

Set cn = New ADODB.Connection

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strSource & ";"

Set rs = New ADODB.Recordset
rs.Open strSQL, cn
rcArray = rs.GetRows


With Sheets("FRONT").cmbEmployee
.Clear
.ColumnCount = 1
.List = Application.Transpose(rcArray)
.ListIndex = -1
End With


rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
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
Load & Access a UserForm ComboBox Minitman Excel Programming 4 August 30th 08 12:19 AM
addins dont load when launched by access Daniel M Excel Programming 1 November 30th 07 12:06 PM
cpu load excel with access queries Ozz Excel Discussion (Misc queries) 0 July 25th 06 08:15 AM
Looking for Macro to load data from Access table Randy K New Users to Excel 1 February 25th 06 12:30 PM
How to load/insert/update an embedded word object to Access... MJ Excel Programming 0 February 21st 06 11:50 PM


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