SELECT Query Help

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I have two tables (People and Job). There is a One to
One relationship between the two tables. I have one
field in the People table (ppletitle) that is a combo box
and it looks up job titles in the Job table (jobtitle).
I want another field in the People table(pplegfy03)to
automatically enter in the corresponding hourly rate in
the Job table (jobgfy03) depending upon what is selected
in the ppletitle field. I have tried this SELECT
statement but it doesn't seem to work.

SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle=[ppletitle]));

Thank you for your help in advance
 
SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle=[ppletitle]));
Where do you put this SQL statement?

If you running it from code in the form, you should change it to :

strSQL = "SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle= " & ppletitle & "))"

And if it's run from a query object, it should read.


SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job WHERE
((job.jobtitle=[EnterFormNameHere].[ppletitle]))
 
SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle=[ppletitle]));
Where do you put this SQL statement?

If you running it from code in the form, you should change it to :

strSQL = "SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle= " & ppletitle & "))"

And if it's run from a query object, it should read.


SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job WHERE
((job.jobtitle=[EnterFormNameHere].[ppletitle]))


Oops error in privous post... See here for correction...
As I'm guessing jobtitle is a string...
SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle=[ppletitle]));
Where do you put this SQL statement?

If you running it from code in the form, you should change it to :

strSQL = "SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job
WHERE ((job.jobtitle= '" & ppletitle & "'))" 'notice the quotes

And if it's run from a query object, it should read.


SELECT Job.jobgfy03, Job.jobtitle, Job.[jobid] FROM Job WHERE
((job.jobtitle=[EnterFormNameHere].[ppletitle]))
 
Back
Top