My Assistant
![]() ![]() |
|
|
Jan 8 2007, 02:11 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 248 |
I've got an application where I'm querying for data and pasting data on Hidden sheets and using it for Row Sources for Lists and Como box's. Is there a way to set the Row Source for a List or Combo box to an SQL Statement. Is the way I'm doing it faster now instead of using an SQL Statement. I think it'll be cleaner in the long run.
|
|
|
|
Jan 8 2007, 02:37 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 4,295 |
Dennis
There's no way I know that you can actually use SQL for the Row Source property in Excel. You could probably do it in code using the AddItem method or List. Or perhaps a dynamic named range. Edited by: norie on Mon Jan 8 14:40:29 EST 2007. |
|
|
|
Jan 8 2007, 02:42 PM
Post
#3
|
|
|
UtterAccess Addict Posts: 248 |
I was just wondering if I was doing it the right way or if using SQL would be faster looks like I'm just going to keep using what I have been. See below
dim cboValues as Variant cboValues = Range("Employees").Value 'Defined hidden range that gets populated when the spreadsheet opens With FormLogin.cboAllEmps .ColumnWidths = 25 .ColumnCount = 2 .List = cboValues End With Thanks |
|
|
|
Jan 8 2007, 02:52 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 4,295 |
Dennis
That code looks fine to me, but there is one possible change you could make. If Employees is a named range this should work. CODE With FormLogin.cboAllEmps .ColumnWidths = 25 .ColumnCount = 2 .RowSource = "Employees" End With I've no idea if it will help with performance/speed though.(IMG:http://www.utteraccess.com/forum/style_emoticons/default/dazed.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 02:30 PM |