Query Not picking up correct text box contents.

C

Cathy

I have a standard form (called Form1) with an unbound textbox called
txtDescription. The default value for the textbox is "test". I also have a
query that pulls the contents of txtDescription:

SELECT Options_Report.ID AS IDENTIFIER,
Forms!Form1.txtDescription AS DESCRIPTION
FROM Options_Report

I need the same description to appear next to each identifier. My problem
is that this query always pulls the default value (test), never the
description that it typed in the txtdescription textbox. If I take out the
default description, then it works... but I really wanted to have a default
value to prompt the users as to the type of content I'm expecting.

What am I doing wrong?

Thank you!
 
K

KARL DEWEY

SELECT Options_Report.ID AS IDENTIFIER, Forms!Form1.txtDescription AS
DESCRIPTION
WHERE Options_Report.ID = Forms!Form1.txtDescription
FROM Options_Report;
 
C

Cathy

Thanks for trying Karl, but the ID is a numeric field, and the Description is
a text field. They will never equal. I need a way to apply the same text (a
variable provided by the user) to every ID.

Thanks again,
 
K

KARL DEWEY

You got to match something. Do you have a table that has the ID and
Description?
 
C

Cathy

Karl,

I'm not trying to match anything. All I need to do is take each value from
one field from a table and have it create a report next to a description that
the user supplies. It needs to be the same description all the way down the
page. My logic does pick up a description. But if I have a value in the
default value, it always will pick up the default instead of the message
typed in the box.
 
K

KARL DEWEY

Ok, what you need is an event or macro to refresh the query after you update
the field in the form. Trigger it from the textbox property After Update.
 
C

Cathy

THANK YOU!!

KARL DEWEY said:
Ok, what you need is an event or macro to refresh the query after you update
the field in the form. Trigger it from the textbox property After Update.
 

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