SELECT stmt using a range name?

  • Thread starter Thread starter mcdowell
  • Start date Start date
M

mcdowell

I have a UserForm which utilizes a section of a worksheet as a
datatable. The form navigates through the records forward and back,
can add new records and edit existing ones. The procedure first
deletes an old range name and creates a new name based on todays total
records.
I have added a listbox wherein I would like to display other records in
the same range which match the content of a text box control on the
same form.
In Access I would use a simple SELECT (fields) FROM (table) WHERE
(field = x). to construct a stmt for the RowSource for the new
listbox. I've tried using Column references for the SELECT as well as
Column Headings and the range name for the FROM. I can't seem to get
anything to work. Any suggestions from anyone??
 
what.. are you complaining that excel isnt a database?
<grin>


afaik you cant use ADO recordsets with rowsource...
you'll have to read the values to the listbox.list

which wouldnt be a problem for you as it's display only.

for lots of info on working with ado recordsets
http://www.erlandsendata.no/english/index.php?t=envbadac

or from the same guru:
http://www.exceltip.com/show_tip/User_Forms,
_Input_boxes_in_VBA/Fill_a_ListBox-
control_with_values_from_another_workbook_using_VBA_in_Microsoft_Excel/4
10.html

suc6!



keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Back
Top