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

Can I write separate query for text box?

Status
Not open for further replies.

kjyang

Programmer
Feb 5, 2002
1
US
I have a report linked to a query. I also have a table called Constants:

Variable Value
Year 2001
... ...


I used "Year" to print the year number on my reports. Since "Year" is not available from the query used by the report, I was wondering if it is possible to create a Text Box and write an query in the Control Source field like this to extract the year:

SELECT Value FROM Constants WHERE Variable = "Year";

I tried doing this but it doesn't work. Is it possible to use queries in text boxes? Is there another way to get this done?

Thanks in advance.
 
Are you just trying to print the current year? If so use =Year() in the textbox.

If not, then perhaps you can include the table containing the year in the query. Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top