Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default getting table name from a text box query

I have succsessfully made a datebase connection using DAO. now I want to get
data from a specific table of database using table name written in combobox.
what will be a quaery for retriving table name from a combobox or textbox.

example:

rs=db.openrecordset("select * from combobox1.text)"
but its not working
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default getting table name from a text box query

Probably because you are not referencing the control explicitly. That is
the ComboBox or TextBox, if these are on the worksheet refer to them as

Sheets("SheetName").ComboBox1.Value

or UserForm

UserForm1.ComboBox1.Value

I personally would store the control value to variable and refer to that,
also trim the value in case there are spurious spaces in the string!

--

Regards,
Nigel




"Kamran" wrote in message
...
I have succsessfully made a datebase connection using DAO. now I want to
get
data from a specific table of database using table name written in
combobox.
what will be a quaery for retriving table name from a combobox or textbox.

example:

rs=db.openrecordset("select * from combobox1.text)"
but its not working


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
Web Query and table? Donal McWeeney Excel Programming 8 May 23rd 07 10:32 AM
How can I get VBA to create a table or run a query in MS SQL? Rubble Excel Programming 6 April 12th 06 02:46 PM
Make Table Query into Text File XP Excel Programming 0 September 14th 05 03:38 PM
VB way to remove the query from a Query Table? Toby Erkson[_3_] Excel Programming 4 October 29th 04 03:16 PM
Linking a table in Access to a table in Excel using MS Query Diana[_5_] Excel Programming 1 January 16th 04 09:43 PM


All times are GMT +1. The time now is 08:51 AM.

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"