473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using user input in a query to select different table

42
Hi

have this query which works ok now :

Expand|Select|Wrap|Line Numbers
  1.  SELECT *
  2. FROM [Table]
  3. WHERE (((Table.published) Like '*'&[Forms]![Search_Records]![Combo7]& '*' And (Table.published) Like '*'&[Forms]![Search_Records]![Combo9]& '*' and  (Table.address) Like '*'&[Forms]![Search_Records]![txtcity]& '*'  )); 
and instead of using the default table which in this case is [Table] , i want to let the user to input which table the query to search on , and what i did is this

Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM [Forms]![Search_Records]![txttable]
  3. WHERE ((([Forms]![Search_Records]![txttable].published) Like '*'&[Forms]![Search_Records]![Combo7]& '*'
  4. And ([Forms]![Search_Records]![txttable].published) Like '*'&[Forms]![Search_Records]![Combo9]& '*' 
  5. and  ([Forms]![Search_Records]![txttable].address) Like '*'&[Forms]![Search_Records]![txtcity]& '*'  )); 
but for some reason is not working.
Can anyone tell me what am i doing wrong ??

Thanks.
May 18 '10 #1
0 1180

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Botao | last post by:
Hi, Every Guru, I'd like to put a button on a page. When clicking the button, the table below it gets selected so the user can do Ctrl C to copy the entire table without using the mouse to...
12
by: TP | last post by:
Here is my problem. I need to display a table about which I have no information except the table name. Using metadata I can somehow show the column names and record values. But my table has 1...
1
by: jpr | last post by:
Friends, I would like some help with a code that allows me to run an append query only if a specific field is not already stored into another table. Example. I add a new customer to my database...
5
by: doc1355 | last post by:
Hi, I have a script that I need to use a variable to select the database table that I want to update or to get the results from. But for some reason when I use the variable I get error. If I...
5
by: yohan610 | last post by:
i have to build a program where the user enters the required input and output filenames..how do i open such files? tht is input_file = fget(............) finput =fopen(input_file,"rb") i...
2
by: freddy windey | last post by:
Hi, this my 1st time i join discussion. im just a new programmer. i need help from your expert on this "Insert data using 1 form to 2 different table"- ASP VBscript. example- name: age: DOB:...
2
by: Carin Botha | last post by:
I want to create a Stored Procedure or a view and ask for user input. Example: Select name from partner where code = 'User Input'. Could you help please?
10
by: mbatestblrock | last post by:
Hi there,I dont even know if this is something that anyone will answer on here but I thought Id give her a shot! I am super new to VWD, and I am in desperate need of some assistance. I have...
8
Misaio
by: Misaio | last post by:
I'm trying to create a program that prompts the user to put in several different numbers. I'd like to put those numbers into an array for easy use. To save me time on coding, I want to loop the...
3
by: rickytb | last post by:
Hey all, I've hit a snag on a beginner Java problem involving building occupancy. I'm supposed to get user input from a GUI. My main problem is that I'm totally lost on how to take the information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.