Query with Criteria pulling from a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.
 
I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

JL said:
Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


AJ said:
What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

Was the form open with the value in the textbox when you run your query?


AJ said:
I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

JL said:
Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


AJ said:
What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

What is your Form Name? What is your query Name? Do you mind post your
query?


AJ said:
I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

JL said:
Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


AJ said:
What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

JL said:
Hi AJ,

Was the form open with the value in the textbox when you run your query?


AJ said:
I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

JL said:
Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


AJ said:
Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

JL said:
Hi AJ,

Was the form open with the value in the textbox when you run your query?


AJ said:
I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

JL said:
Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


AJ said:
Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

JL said:
Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


AJ said:
The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

JL said:
Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


AJ said:
Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
JL said:
Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


AJ said:
The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

JL said:
Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
..... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

AJ said:
Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
JL said:
Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


AJ said:
The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
The [Team Leader] when entered by a user is pulled from another table. This
table is the ID # table where the fields are ID (primary Key), Name, ID #,
Email. This is the same table I'm using to chose the name from for Combo9 or
Text14. I went in and changed [Team Leader] to be text as it was number when
I went in. Even with that change I'm not getting what I'm looking for. For
whatever reason I can enter a # into the query and it runs perfectly and when
it displays the actual text is displayed. But, if I type in a name it pulls
back nothing. I think I may have to find another way to get what I want here
since nothing I"m doing is fixing the problem. Thanks so much for all your
help. You got me further than anyone else.

JL said:
Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
.... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

AJ said:
Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
JL said:
Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


:

The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

You are so close to get this working. Based on what you just say, it is a
number ID field. You form textbox has to be 1 of the valid number ID field
from your table (I am sure it is right now).

Couple thing to try.

Create a simpler query using the same form. Type a number in Text14. With
the Form open, try the following.

Simple Query:
SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Forms![frmQueryTeamLeaderreport]![Text14];

If it does not return the same number as Text14, try the query below.

SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Val(Forms![frmQueryTeamLeaderreport]![Text14]);

One of them or both of them should work. I do this kind of stuff all the
time. I just can't believe it is not working.

If it is till not working, I can give you one of my junk email address. You
can sent me the zipped up version of your Access (Just sample data). I can
take it look at it.


AJ said:
The [Team Leader] when entered by a user is pulled from another table. This
table is the ID # table where the fields are ID (primary Key), Name, ID #,
Email. This is the same table I'm using to chose the name from for Combo9 or
Text14. I went in and changed [Team Leader] to be text as it was number when
I went in. Even with that change I'm not getting what I'm looking for. For
whatever reason I can enter a # into the query and it runs perfectly and when
it displays the actual text is displayed. But, if I type in a name it pulls
back nothing. I think I may have to find another way to get what I want here
since nothing I"m doing is fixing the problem. Thanks so much for all your
help. You got me further than anyone else.

JL said:
Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
.... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

AJ said:
Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
:

Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


:

The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
JL,
thanks so much for your patience. I tried what you said below. The first
one didn't work at all. The second one... was so close. It finally ran
perfect except for one problem. It is only pulling where ID =1 no matter
what name I'm putting in the form. If you are willing to let me zip this up
and send it I would be most appreciative.

Thanks

JL said:
Hi AJ,

You are so close to get this working. Based on what you just say, it is a
number ID field. You form textbox has to be 1 of the valid number ID field
from your table (I am sure it is right now).

Couple thing to try.

Create a simpler query using the same form. Type a number in Text14. With
the Form open, try the following.

Simple Query:
SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Forms![frmQueryTeamLeaderreport]![Text14];

If it does not return the same number as Text14, try the query below.

SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Val(Forms![frmQueryTeamLeaderreport]![Text14]);

One of them or both of them should work. I do this kind of stuff all the
time. I just can't believe it is not working.

If it is till not working, I can give you one of my junk email address. You
can sent me the zipped up version of your Access (Just sample data). I can
take it look at it.


AJ said:
The [Team Leader] when entered by a user is pulled from another table. This
table is the ID # table where the fields are ID (primary Key), Name, ID #,
Email. This is the same table I'm using to chose the name from for Combo9 or
Text14. I went in and changed [Team Leader] to be text as it was number when
I went in. Even with that change I'm not getting what I'm looking for. For
whatever reason I can enter a # into the query and it runs perfectly and when
it displays the actual text is displayed. But, if I type in a name it pulls
back nothing. I think I may have to find another way to get what I want here
since nothing I"m doing is fixing the problem. Thanks so much for all your
help. You got me further than anyone else.

JL said:
Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
.... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

:

Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
:

Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


:

The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Hi AJ,

Sorry, Did not have change to check over the weekend. I will give you an
email address. Please put your email address on the subject line. I will
then email you an address to sent to me. The yahoo email is blocked due to
company policy. But, I can see the subject line only. The email address
that I can sent you is my contract company (Contract is up soon, there might
be possible renewal or another assignment elsewhere). You can then sent you
zipped file to that new address. Please keep it small. There is limit on
how big the file can be sent. After that, hopefully that I will resolve your
issue and sent the correct query to you. I am sorry to do this, but it is
the only way. The yahoo mail is "(e-mail address removed)". Hope you understand,
I don't care about this account, because I probably will remove it in a few
month. This is just a junk mail address for me. I do not want my to list
any other email address in public beside that one.

Hope you will get this then I can resolve your issue. Looking forward to
the email in the yahoo account.



AJ said:
JL,
thanks so much for your patience. I tried what you said below. The first
one didn't work at all. The second one... was so close. It finally ran
perfect except for one problem. It is only pulling where ID =1 no matter
what name I'm putting in the form. If you are willing to let me zip this up
and send it I would be most appreciative.

Thanks

JL said:
Hi AJ,

You are so close to get this working. Based on what you just say, it is a
number ID field. You form textbox has to be 1 of the valid number ID field
from your table (I am sure it is right now).

Couple thing to try.

Create a simpler query using the same form. Type a number in Text14. With
the Form open, try the following.

Simple Query:
SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Forms![frmQueryTeamLeaderreport]![Text14];

If it does not return the same number as Text14, try the query below.

SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Val(Forms![frmQueryTeamLeaderreport]![Text14]);

One of them or both of them should work. I do this kind of stuff all the
time. I just can't believe it is not working.

If it is till not working, I can give you one of my junk email address. You
can sent me the zipped up version of your Access (Just sample data). I can
take it look at it.


AJ said:
The [Team Leader] when entered by a user is pulled from another table. This
table is the ID # table where the fields are ID (primary Key), Name, ID #,
Email. This is the same table I'm using to chose the name from for Combo9 or
Text14. I went in and changed [Team Leader] to be text as it was number when
I went in. Even with that change I'm not getting what I'm looking for. For
whatever reason I can enter a # into the query and it runs perfectly and when
it displays the actual text is displayed. But, if I type in a name it pulls
back nothing. I think I may have to find another way to get what I want here
since nothing I"m doing is fixing the problem. Thanks so much for all your
help. You got me further than anyone else.

:

Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
.... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

:

Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
:

Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


:

The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Check your yahoo, I sent my email address to there.

thanks again

JL said:
Hi AJ,

Sorry, Did not have change to check over the weekend. I will give you an
email address. Please put your email address on the subject line. I will
then email you an address to sent to me. The yahoo email is blocked due to
company policy. But, I can see the subject line only. The email address
that I can sent you is my contract company (Contract is up soon, there might
be possible renewal or another assignment elsewhere). You can then sent you
zipped file to that new address. Please keep it small. There is limit on
how big the file can be sent. After that, hopefully that I will resolve your
issue and sent the correct query to you. I am sorry to do this, but it is
the only way. The yahoo mail is "(e-mail address removed)". Hope you understand,
I don't care about this account, because I probably will remove it in a few
month. This is just a junk mail address for me. I do not want my to list
any other email address in public beside that one.

Hope you will get this then I can resolve your issue. Looking forward to
the email in the yahoo account.



AJ said:
JL,
thanks so much for your patience. I tried what you said below. The first
one didn't work at all. The second one... was so close. It finally ran
perfect except for one problem. It is only pulling where ID =1 no matter
what name I'm putting in the form. If you are willing to let me zip this up
and send it I would be most appreciative.

Thanks

JL said:
Hi AJ,

You are so close to get this working. Based on what you just say, it is a
number ID field. You form textbox has to be 1 of the valid number ID field
from your table (I am sure it is right now).

Couple thing to try.

Create a simpler query using the same form. Type a number in Text14. With
the Form open, try the following.

Simple Query:
SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Forms![frmQueryTeamLeaderreport]![Text14];

If it does not return the same number as Text14, try the query below.

SELECT Table1.[Team Leader] From Table1 Where Table1.[Team Leader] =
Val(Forms![frmQueryTeamLeaderreport]![Text14]);

One of them or both of them should work. I do this kind of stuff all the
time. I just can't believe it is not working.

If it is till not working, I can give you one of my junk email address. You
can sent me the zipped up version of your Access (Just sample data). I can
take it look at it.


:

The [Team Leader] when entered by a user is pulled from another table. This
table is the ID # table where the fields are ID (primary Key), Name, ID #,
Email. This is the same table I'm using to chose the name from for Combo9 or
Text14. I went in and changed [Team Leader] to be text as it was number when
I went in. Even with that change I'm not getting what I'm looking for. For
whatever reason I can enter a # into the query and it runs perfectly and when
it displays the actual text is displayed. But, if I type in a name it pulls
back nothing. I think I may have to find another way to get what I want here
since nothing I"m doing is fixing the problem. Thanks so much for all your
help. You got me further than anyone else.

:

Hi AJ,

Your [Team Leader] is coming from table "Table1". The definition is in
"Table1". If the "[Team Leader]" is defined as number or text, but the
actual value is "1" (1), "2" (2), ... etc. Then your form field "[Text14]"
has to show 1, 2, .... etc.

If the definition is text and the actual value is "JL", "AJ", "ABC", "DEF",
.... etc. Then your form field "[Text14]" has to show "JL", "AJ", "ABC",
"DEF", .... etc.

I hope this will resolve your problem.

:

Here is the SQL view of the query (learn something new everyday! - thanks)

SELECT Table1.[Team Leader], Table1.Closed, Table1.[QI Type], Table1.[QI #],
Table1.[Part #], Table1.[Batch Code], Table1.[MO#], Table1.Returned,
Table1.[Corrective Actions Accepted by QA], Table1.[Corrective Actions
Complete and Sent to QA], Table1.[Rejection Reason], Table1.[Rejection Type],
Table1.[Resources Needed 1], Table1.[Resources Needed 2], Table1.[Resources
Needed 3], Table1.[Resources Needed 4], Table1.[Resources Needed 5],
Table1.[Issue Date]
FROM Table1
WHERE (((Table1.[Team
Leader])=[Forms]![frmQueryforTeamLeaderreport]![Text14]));

Team Leader was number field. I changed it to text. Now, I can type in
the name and I don't get an error, but I don't get the records either.

I'm trying to figure out how to set the Text14 to a text and see if that
works, not really sure how (though I'm certain it is something obvious I'm
missing)

thanks again.
:

Hi AJ,

Ok, it looks like you have everything in the right place.
Questions:
1) Is the "[Team Leader]" a number (ID) or name string?
2) Is the "Text14" textbox on the form a number or name string?

If they are name string, then make sure the case are matching and the table
actually have that name exist.

If they are number, you can try
"Val([Forms]![frmQueryforTeamLeaderreport]![Text14]) to force to be a number.

To paste the whole SQL statement, in Query Tab, hit "Design" to open the
query in question. Then under "View", there should have "SQL View". Then
you will be able to see the whole SQL query.


:

The Form Name is: frmQueryTeamLeaderreport

The Query is: Open QI Query

The Sql Statement as copied directy from the criteria section under teh
filed Team Leader is: [Forms]![frmQueryforTeamLeaderreport]![Text14]

Thanks for helping me.

:

Hi AJ,

You can copy the SQL from the Query Design. Under the same icon or pull
down, there is a SQL. That will give you the SQL statement.
I also need to know the Form name and Query name. My guess is that you get
those mixed up. That is why I need to see it and fix it for you.


:

Yes, the form was set to me.visible after Update. I went and removed that
and tried and still got the same error though.

How do i post the query? COuld I zip up the database and send it to you?

Thanks for your help!

:

Hi AJ,

Was the form open with the value in the textbox when you run your query?


:

I tried this. I'm still getting the same error when I run the query. I set
up Text 14 and it works great on the form, it shows the name. I put this in
the criteria for the query

the field is Team Leader the criteria is
[form]![frmQueryforTeamLeader]![Text14]

Again, it still gives me the same error I had before.

thanks

:

Hi AJ,

To answer your question.
You have to create another textbox (hidden or visible) to store your value
in it and then use it to do your query.

My best guess is that the "Column(?)" only exist in memory (when the combo
box is active). That is the reason that you can not reference it.

Hope this helps.


:

What is the syntax to get a query to recognize the second column from a Combo
box?

In the criteria section of the query from design view I have :

[Forms]![frmQueryforTeamLeaderreport]![Combo9].Column(1)

The query gives me a "unidentified function" error when I run it with this
in it. If I just leave the Coulmn(1) off then the query doesn't run
correctly in that it will only accept values equal to the first column in my
Combo. Note that Combo9 allows you to shoose from a table that has ID and
Name as the columns. ID is just the number and the primary Key. The Combo
properly allows me t select teh name. However, when I type in the name when
the query prompts for criteria I get errors. It wants the number. I need to
make it accept the name.

thanks for any help anyone can give me, and i am very appreciate to all of
you who have gotten me this far.
aj
 
Back
Top