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!

Query help - Fields from a table - Combo boxes

Status
Not open for further replies.

lskuff

Programmer
May 19, 2004
20
US
This is probably an easy question but I am writing a query to get the field names from a table for a combo box. I know how to do this. The question I have is I don't want to use the exact names that are in the table.

Example - in my table a field is called "JOB_DESC" I want it to say "Job Description" in my combo box. How do I do this?

 
in the query, if you type job description: in front of the field name JOB_DESC, so that in the query it will read
job description:job_desc When you see the results of the query, you will then only see the alias of job description, but with the results of job_desc
 
SO I have my query like so:

SELECT Attendee.Category, Attendee.JOB_DESC, Attendee.PROF_DESC FROM Attendee ORDER BY Attendee.Category;

and to get it to display I would write

Job Description:Attendee.JOB_DESC
or like Attendee.Job Description:JOB_DESC

because I have tried a lot of combinations and it does not seem to be working. Thanks.
 
Try this:
SELECT Attendee.Category, Attendee.JOB_DESC [highlight]AS [Job Description][/highlight], Attendee.PROF_DESC FROM Attendee ORDER BY Attendee.Category;

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
sorry, I was in Access Query Analyser mode, as opposed to SQL. as PHV's suggestion :)
 
Okay great it is working now. I just want to know one more thing.... How can I get the JOB_DESC not the Job Description using VB code. Because if I do like Me!cmbox1 then it now returns "Job Description" instead of JOB_DESC... how can I get it back?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top