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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temporary fields in queries

Status
Not open for further replies.

nedstar1

IS-IT--Management
Mar 2, 2001
127
US
Access newbie alert!

I'm working on a query that will be part of a form I'm building. I want to have the query prompt for four integer values, then use these values as the basis for a series of simple calculations. I know that I can get the query to prompt for the parameters by entering the prompt in [brackets] in the criteria field. What I am wondering is whether I can enter a non-existent field name as a placeholder to then call that value from another query, without storing the values in a table (it is unimportant to retain these values). Is this possible? How would I go about it?

Any and all advice is greatly appreciated.

Regards,
Ned
 
To clarify this a bit - how do I define a field in a query with a field name other than exp1 or exp2? If I calll that field with another query, will it trigger the first query?

Thanks
Regards,
Ned
 
To define a field name other than exp1 simply type the name you want followed by a colon

Example:


MyFieldName: [Enter A Value]

To answer the next question, Yes if you call this field name from another query it will trigger the first query.

HTH
Mike

[penguin] Dooobie...Doobie......Dooo
 
You can add a field eg NewField: [Sometablefield] + [Enter your number]

The query will then prompt you for your number and add it to the Sometablefield value to produce a new column of data you can do what you like with.

If you use this query as a basis for another, you will be prompted by this one when you run the other one.

 
Thanks both of you for the rapid repsonse. I learned a few things: first, you can prompt for the data in the field name instead of in the criteria field. Is there a reason to use one or the other, or a reason to use both?

Next, everytime I run the query, it prompts me for my values, but then it opens and displays only the fieldname headings. I set it up as a select query - is this the right or wrong method?

Thanks again.
 
Prompting in the field name line allows you to do expressions - is part of the SELECT. In the criteria you affect the WHERE clause.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top