Populate a Text Field

G

Guest

I have a form in which field RDIngPKIDDescription gets populated through this
code in its Control Source:
=[RDIngPKID].[Column](1)

I need this in my report as well but haven't a clue how to make it happen.
The field in my report is also RDIngPKIDDescription.

Is it possible to populate the report field?

Thanks!
 
A

Al Campagna

John,
The query behind your form combo gets the RDIngPKIDDescription information from some
table, and when you select an RDIngPKID (probably in Col(0) of the combo), you can
"display" that associated RDIngPKIDDescription.
= [RDIngPKID].[Column](1) is a "display" only calculated field, and only gets it's
value from the combo column "on the fly"... and does not update the form's table... and
that is the correct way to do it.
But, in the query behind the report, you'll need to link that same RDIngPKIDDescription
(from whatever table you got it from for your combo) to the RDIngPKID being reported on.
However you linked ID to Desc in the form combo, you'll have to do the same in the
report query.
 
G

Guest

Al Campagna said:
But, in the query behind the report, you'll need to link that same RDIngPKIDDescription (from whatever table you got it from for your combo) to the RDIngPKID being reported on. However you linked ID to Desc in the form combo, you'll have to do the same in the report query.

Thanks, Al. That makes sense however there's a bit of a complication and
I'll do my best to spell things out. I'll refrain from going into all of the
horrific details but please trust that this design is correct and logical
within the context of this particular database.

The Description field is indeed in the report's query:

SELECT tblProfiles.*, tblProfilesRevisions.*, tblProfiles.Description
FROM tblProfiles INNER JOIN tblProfilesRevisions ON tblProfiles.txtProfileID
= tblProfilesRevisions.txtProfileID;

RDIngPKIDDescription uses tblProfiles.Description based off the selected
value in RDIngPKID.

tblProfiles.txtProfileID is the Master Link for the report. So what happens
is that the Description field appears in RDIngPKID according to txtProfileID
and NOT according to the value in RDIngPKID.

WHEW!

I hope that makes sense!

It seems to me that I may need to create an alias Description field in the
query...?
JohnLute said:
I have a form in which field RDIngPKIDDescription gets populated through this
code in its Control Source:
=[RDIngPKID].[Column](1)

I need this in my report as well but haven't a clue how to make it happen.
The field in my report is also RDIngPKIDDescription.

Is it possible to populate the report field?

Thanks!
 
M

Marshall Barton

JohnLute said:
I have a form in which field RDIngPKIDDescription gets populated through this
code in its Control Source:
=[RDIngPKID].[Column](1)

I need this in my report as well but haven't a clue how to make it happen.
The field in my report is also RDIngPKIDDescription.


You should base the report on a query that joins the table
with the description field. Include the description
**field** from its table in the query's field list to make
the **field** available for use in a bound text box
**control**
 
A

Al Campagna

John,
Very difficult to determine without seeing your tables and data... and it "seems" like
a table design problem. We'll see... can't be sure yet.

Show me the table structure, and the pertinent fields, and some sample data that you
have in tblProfiles and tblProfileRevisions.
Basically "what you have for data... vs... what you want to see."

Note: It is possible to use a second copy of a table (the one with the
RDIngPKIDDescription field) in your query and relate it to tblProfiles RDIngPKID, but...
that shouldn't be necessary with normalized data tables.
However you related the RDIngPKID and RDIngPKIDDecription in your combo is the way it
should be in the report query.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


But, in the report, you want to see that same RDIngPKIDDescription WITHOUT including
the RDIngPKID
JohnLute said:
Al Campagna said:
But, in the query behind the report, you'll need to link that same RDIngPKIDDescription
(from whatever table you got it from for your combo) to the RDIngPKID being reported on.
However you linked ID to Desc in the form combo, you'll have to do the same in the
report query.

Thanks, Al. That makes sense however there's a bit of a complication and
I'll do my best to spell things out. I'll refrain from going into all of the
horrific details but please trust that this design is correct and logical
within the context of this particular database.

The Description field is indeed in the report's query:

SELECT tblProfiles.*, tblProfilesRevisions.*, tblProfiles.Description
FROM tblProfiles INNER JOIN tblProfilesRevisions ON tblProfiles.txtProfileID
= tblProfilesRevisions.txtProfileID;

RDIngPKIDDescription uses tblProfiles.Description based off the selected
value in RDIngPKID.

tblProfiles.txtProfileID is the Master Link for the report. So what happens
is that the Description field appears in RDIngPKID according to txtProfileID
and NOT according to the value in RDIngPKID.

WHEW!

I hope that makes sense!

It seems to me that I may need to create an alias Description field in the
query...?
JohnLute said:
I have a form in which field RDIngPKIDDescription gets populated through this
code in its Control Source:
=[RDIngPKID].[Column](1)

I need this in my report as well but haven't a clue how to make it happen.
The field in my report is also RDIngPKIDDescription.

Is it possible to populate the report field?

Thanks!
 

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

Similar Threads


Top