Help Parameter Query .

G

Guest

I am trying to make a parameter query that allows a user to specify a
recruitment date (mm-yyyy). I suspect that my data types are wrong in the two
tables I am referring to. The Recrutiment ID field in the Applicant Data
table is populated by the
values of the Recruitment Date field in the Recruitment Tracking Table
table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

Nowe whenever I try to run my parameter query against it I return no
records . even though I have verified that the data I imput into the pop-ups
should return at least 1 record.

Here is the SQL of the query.
************************************************************
SELECT [Applicant Data].[Recruitment ID], [Applicant Data].Position,
[Applicant Data].First_Name, [Applicant Data].Middle_Init, [Applicant
Data].Last_Name, [Applicant Data].Address, [Applicant Data].City, [Applicant
Data].State, [Applicant Data].Zip_Code, [Applicant Data].Race, [Applicant
Data].Sex
FROM [Applicant Data] INNER JOIN [Recruitment Tracking Table] ON [Applicant
Data].ID = [Recruitment Tracking Table].ID
WHERE ((([Applicant Data].[Recruitment ID])=[What ID # ?]) AND (([Applicant
Data].Position)=[What is the Position Name ?]) AND (([Applicant
Data].Sex)=[What Gender?]));
************************************************************

Any Ideas ?
Thank you in advance
 
O

OfficeDev18 via AccessMonster.com

I think your problem is here:

************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

I think you can only return one field in a subquery; you're returning two, ID
and Recruitment Date. Try removing the Recruitment Date from the subq.

The truth is, though, I don't see why you need the subquery altogether. What
happens if you run the param q without it?

Sam
I am trying to make a parameter query that allows a user to specify a
recruitment date (mm-yyyy). I suspect that my data types are wrong in the two
tables I am referring to. The Recrutiment ID field in the Applicant Data
table is populated by the
values of the Recruitment Date field in the Recruitment Tracking Table
table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

Nowe whenever I try to run my parameter query against it I return no
records . even though I have verified that the data I imput into the pop-ups
should return at least 1 record.

Here is the SQL of the query.
************************************************************
SELECT [Applicant Data].[Recruitment ID], [Applicant Data].Position,
[Applicant Data].First_Name, [Applicant Data].Middle_Init, [Applicant
Data].Last_Name, [Applicant Data].Address, [Applicant Data].City, [Applicant
Data].State, [Applicant Data].Zip_Code, [Applicant Data].Race, [Applicant
Data].Sex
FROM [Applicant Data] INNER JOIN [Recruitment Tracking Table] ON [Applicant
Data].ID = [Recruitment Tracking Table].ID
WHERE ((([Applicant Data].[Recruitment ID])=[What ID # ?]) AND (([Applicant
Data].Position)=[What is the Position Name ?]) AND (([Applicant
Data].Sex)=[What Gender?]));
************************************************************

Any Ideas ?
Thank you in advance
 
G

Guest

HelloWorld said:
I am trying to make a parameter query that allows a user to specify a
recruitment date (mm-yyyy). I suspect that my data types are wrong in the two
tables I am referring to. The Recrutiment ID field in the Applicant Data
table is populated by the
values of the Recruitment Date field in the Recruitment Tracking Table
table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

Nowe whenever I try to run my parameter query against it I return no
records . even though I have verified that the data I imput into the pop-ups
should return at least 1 record.

Here is the SQL of the query.
************************************************************
SELECT [Applicant Data].[Recruitment ID], [Applicant Data].Position,
[Applicant Data].First_Name, [Applicant Data].Middle_Init, [Applicant
Data].Last_Name, [Applicant Data].Address, [Applicant Data].City, [Applicant
Data].State, [Applicant Data].Zip_Code, [Applicant Data].Race, [Applicant
Data].Sex
FROM [Applicant Data] INNER JOIN [Recruitment Tracking Table] ON [Applicant
Data].ID = [Recruitment Tracking Table].ID
WHERE ((([Applicant Data].[Recruitment ID])=[What ID # ?]) AND (([Applicant
Data].Position)=[What is the Position Name ?]) AND (([Applicant
Data].Sex)=[What Gender?]));
************************************************************

Any Ideas ?
Thank you in advance

I reformatted you query to make it easier to read:

'-----------------------------------------
SELECT
[Applicant Data].[Recruitment ID],
[Applicant Data].Position,
[Applicant Data].First_Name,
[Applicant Data].Middle_Init,
[Applicant Data].Last_Name,
[Applicant Data].Address,
[Applicant Data].City,
[Applicant Data].State,
[Applicant Data].Zip_Code,
[Applicant Data].Race,
[Applicant Data].Sex

FROM
[Applicant Data] INNER JOIN [Recruitment Tracking Table]
ON [Applicant Data].ID = [Recruitment Tracking Table].ID

WHERE
[Applicant Data].[Recruitment ID]=[What ID # ?] AND
[Applicant Data].Position=[What is the Position Name ?] AND
[Applicant Data].Sex)=[What Gender?];
'-----------------------------------------

Q1) All of the fields are from ONE table - [Applicant Data]. Why did you
join the [Recruitment Tracking Table]??

Q2) Is [Applicant Data].ID the Primary Key field for table [Applicant Data]?

Q3) Is [Recruitment Tracking Table].ID the Primary Key field for table
[Recruitment Tracking Table]?

Q4) Which table is the "ONE" and which is the "MANY" table?

Q5) What is the structure of the [Recruitment Tracking Table]?

Q6) What are the fields and data types of the linking fields? (not what is
displayed - the actual defined data type)

table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

A combo box/list box has a row source, not a field...... unless you made a
"Lookup" in the table!? (I recommend getting rid of it - it only causes
headaches by hiding the true contents of the field.)
I think this is what is causing your problems.
 
G

Guest

Answer

q1) Applicant data.Recruitment.ID is dependent on Recruitment Tracking
Table.[Recruitment Date] because I used the data in the Recruitment tracking
table as a lookup value for Applicant Data.Recruitment ID

q2)Yes The Applicant Data.ID field is a Primary key

q3) Yes The Recruitment Tracking Table.ID field is the primary key for the
Recruitment Tracking Table

q4) Unfortunately I am new to queries and do not understand the question
(Many to one )

q5.) Recruitment Tracking Table has three fields ID , Position, and
Recruitment Date : Data Types are as follows ID = Autonumber , Position =
Text , Recruitment Date = Text

q6) The Fields are Recruitment ID from Applicant Data and Recuitment Date
From
Recruitment Tracking Table The data types are Text on both


Can U recieve Screenshots ?


SteveS said:
HelloWorld said:
I am trying to make a parameter query that allows a user to specify a
recruitment date (mm-yyyy). I suspect that my data types are wrong in the two
tables I am referring to. The Recrutiment ID field in the Applicant Data
table is populated by the
values of the Recruitment Date field in the Recruitment Tracking Table
table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

Nowe whenever I try to run my parameter query against it I return no
records . even though I have verified that the data I imput into the pop-ups
should return at least 1 record.

Here is the SQL of the query.
************************************************************
SELECT [Applicant Data].[Recruitment ID], [Applicant Data].Position,
[Applicant Data].First_Name, [Applicant Data].Middle_Init, [Applicant
Data].Last_Name, [Applicant Data].Address, [Applicant Data].City, [Applicant
Data].State, [Applicant Data].Zip_Code, [Applicant Data].Race, [Applicant
Data].Sex
FROM [Applicant Data] INNER JOIN [Recruitment Tracking Table] ON [Applicant
Data].ID = [Recruitment Tracking Table].ID
WHERE ((([Applicant Data].[Recruitment ID])=[What ID # ?]) AND (([Applicant
Data].Position)=[What is the Position Name ?]) AND (([Applicant
Data].Sex)=[What Gender?]));
************************************************************

Any Ideas ?
Thank you in advance

I reformatted you query to make it easier to read:

'-----------------------------------------
SELECT
[Applicant Data].[Recruitment ID],
[Applicant Data].Position,
[Applicant Data].First_Name,
[Applicant Data].Middle_Init,
[Applicant Data].Last_Name,
[Applicant Data].Address,
[Applicant Data].City,
[Applicant Data].State,
[Applicant Data].Zip_Code,
[Applicant Data].Race,
[Applicant Data].Sex

FROM
[Applicant Data] INNER JOIN [Recruitment Tracking Table]
ON [Applicant Data].ID = [Recruitment Tracking Table].ID

WHERE
[Applicant Data].[Recruitment ID]=[What ID # ?] AND
[Applicant Data].Position=[What is the Position Name ?] AND
[Applicant Data].Sex)=[What Gender?];
'-----------------------------------------

Q1) All of the fields are from ONE table - [Applicant Data]. Why did you
join the [Recruitment Tracking Table]??

Q2) Is [Applicant Data].ID the Primary Key field for table [Applicant Data]?

Q3) Is [Recruitment Tracking Table].ID the Primary Key field for table
[Recruitment Tracking Table]?

Q4) Which table is the "ONE" and which is the "MANY" table?

Q5) What is the structure of the [Recruitment Tracking Table]?

Q6) What are the fields and data types of the linking fields? (not what is
displayed - the actual defined data type)

table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

A combo box/list box has a row source, not a field...... unless you made a
"Lookup" in the table!? (I recommend getting rid of it - it only causes
headaches by hiding the true contents of the field.)
I think this is what is causing your problems.
 
G

Guest

These things have changed a little bit as I was working on the DB when I
wasnt at full concentration and "broke' some of the DB functions . There are
quite a few changes and if you desire I could itemize them for you . If not
check your email and depoending on your response I will send you some
screenshots or the DB if you want it .

thanx

Steve

HelloWorld said:
Answer

q1) Applicant data.Recruitment.ID is dependent on Recruitment Tracking
Table.[Recruitment Date] because I used the data in the Recruitment tracking
table as a lookup value for Applicant Data.Recruitment ID

q2)Yes The Applicant Data.ID field is a Primary key

q3) Yes The Recruitment Tracking Table.ID field is the primary key for the
Recruitment Tracking Table

q4) Unfortunately I am new to queries and do not understand the question
(Many to one )

q5.) Recruitment Tracking Table has three fields ID , Position, and
Recruitment Date : Data Types are as follows ID = Autonumber , Position =
Text , Recruitment Date = Text

q6) The Fields are Recruitment ID from Applicant Data and Recuitment Date
From
Recruitment Tracking Table The data types are Text on both


Can U recieve Screenshots ?


SteveS said:
HelloWorld said:
I am trying to make a parameter query that allows a user to specify a
recruitment date (mm-yyyy). I suspect that my data types are wrong in the two
tables I am referring to. The Recrutiment ID field in the Applicant Data
table is populated by the
values of the Recruitment Date field in the Recruitment Tracking Table
table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

Nowe whenever I try to run my parameter query against it I return no
records . even though I have verified that the data I imput into the pop-ups
should return at least 1 record.

Here is the SQL of the query.
************************************************************
SELECT [Applicant Data].[Recruitment ID], [Applicant Data].Position,
[Applicant Data].First_Name, [Applicant Data].Middle_Init, [Applicant
Data].Last_Name, [Applicant Data].Address, [Applicant Data].City, [Applicant
Data].State, [Applicant Data].Zip_Code, [Applicant Data].Race, [Applicant
Data].Sex
FROM [Applicant Data] INNER JOIN [Recruitment Tracking Table] ON [Applicant
Data].ID = [Recruitment Tracking Table].ID
WHERE ((([Applicant Data].[Recruitment ID])=[What ID # ?]) AND (([Applicant
Data].Position)=[What is the Position Name ?]) AND (([Applicant
Data].Sex)=[What Gender?]));
************************************************************

Any Ideas ?
Thank you in advance

I reformatted you query to make it easier to read:

'-----------------------------------------
SELECT
[Applicant Data].[Recruitment ID],
[Applicant Data].Position,
[Applicant Data].First_Name,
[Applicant Data].Middle_Init,
[Applicant Data].Last_Name,
[Applicant Data].Address,
[Applicant Data].City,
[Applicant Data].State,
[Applicant Data].Zip_Code,
[Applicant Data].Race,
[Applicant Data].Sex

FROM
[Applicant Data] INNER JOIN [Recruitment Tracking Table]
ON [Applicant Data].ID = [Recruitment Tracking Table].ID

WHERE
[Applicant Data].[Recruitment ID]=[What ID # ?] AND
[Applicant Data].Position=[What is the Position Name ?] AND
[Applicant Data].Sex)=[What Gender?];
'-----------------------------------------

Q1) All of the fields are from ONE table - [Applicant Data]. Why did you
join the [Recruitment Tracking Table]??

Q2) Is [Applicant Data].ID the Primary Key field for table [Applicant Data]?

Q3) Is [Recruitment Tracking Table].ID the Primary Key field for table
[Recruitment Tracking Table]?

Q4) Which table is the "ONE" and which is the "MANY" table?

Q5) What is the structure of the [Recruitment Tracking Table]?

Q6) What are the fields and data types of the linking fields? (not what is
displayed - the actual defined data type)

table. both fields have a data type of text, 50 characters, the only
difference (obviously ) is that the row source on the Applicant
Data.Recruitment ID field is
************************************************************
SELECT [Recruitment Tracking Table].ID, [Recruitment Tracking
Table].[Recruitment Date] FROM [Recruitment Tracking Table];
************************************************************

A combo box/list box has a row source, not a field...... unless you made a
"Lookup" in the table!? (I recommend getting rid of it - it only causes
headaches by hiding the true contents of the field.)
I think this is what is causing your problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top