Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to query with criteria based on form text box ?

Status
Not open for further replies.

prodtest

Technical User
Aug 29, 2003
55
GB
Hi,
I am new to ADP's but am ok with MDB's, I have worked out how to a build table in a project and have also got forms to enter data into the tables.
But I am struggling with queries, I have basically got all the fields listed on the view, when I run the view with no criteria all is correct, when I enter a basic criteria (i.e. all records with the same job no 3953) it works ok, all records with that job no come out.
But if I tell it to look at a text box on a form to get the criteria from it returns nothing. Below is what I am using.

LIKE '[Forms]!jobentry!jobno'

Help !!!???!!!
 
The concepts are totally different:

MDB is a Jet based application, the queries are defined and run client-side ant they 'see' the forms and controls on forms. That's why it works in MDB.

ADP is a client for SQL Server. 'Queries' (i.e. stored procs, views, functions) are run server-side. The server is not aware of the forms. That's why it does not work in ADP. You need to pass the parameters to the server, run the SQL, then get the result.

Views do NOT accept parameters. Either use a filter on the form or change the view to a stored proc.

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top