repost: Listbox and reports

  • Thread starter Thread starter =?ISO-8859-1?Q?=D8ystein_Sund?=
  • Start date Start date
?

=?ISO-8859-1?Q?=D8ystein_Sund?=

I need help with the problem described below. Please anyone!
I'd really be greatful for any help!


I wrote:
I've got a report that's supposed to have a listbox that looks up error
codes from a table that has a relation to another table. This list is
going to look up this based on an ID number from the other table.

The report will look like this:
ID feilkoder (listbox)
56 doa
dead


The report I've made so far looks like this (without a listbox):
ID feilkoder
56 doa
56 dead


This is not so very practical since a lot of data will be printed i
duplicates (data that I've not included in this example).

So my question is, when Access generates a report, is it possible to get
a value from each post it generates?

Whith MySQL and PHP this would have been pretty easy, but not in Access
when I don't know how. Therefore I wondered if Access uses some internal
variables for each post when it generates a report?

Is there some other way to get the value I need for the rowsource to the
listbox?

Any help, other recommandations or suggestions would be highly appreciated!



HSalim wrote:
Oystein,
IT is difficult to understand what you want.
Is it correct to say that the Fail code? (FeilKoder) is the value you want
to display for ID 56?
Is it correct to say ID 56 can have two possible values - doa and dead?
Do you want to display ID once and just a list of values after that?

HS


I Wrote:
That's right! Sorry for the missing translation. It must have slipped
thru when I translated for Norwegian to English.

There is a table called failcodes (or error codes), a table called
service and a table called service_failcodes.

The table called failcodes has a list of failcodes to use in a service.
The failcodes that are selected is put into the table service_failcodes
with the ID from a post from the table service and the ID of the
selected failcode from the table failcodes.

The report I am making is going to be like I explained at first like this:
ID failcodes (listbox)
56 doa
dead

Not like this:
ID feilkoder
56 doa
56 dead

If there is any other way than using a listbox for this, please explain.


Sincerely
Øystein Sund
 
Excuse my forgotten translations. All words spelled feilkoder is
supposed to be failcodes.


Sincerely
Oystein Sund
 
Oystein,

Greetings. As I understand what your trying to do, you
have a query as the basis for your report and it does, as
it should bring back (in the case of you example) two rows
as follows:

ID Failcode
56 doa
56 dead

You want your report to display:

ID Failcode
56 doa
dead

If that is correct, open your reportin design view and
select the ID field. Open the properties window. You
should find a "Hide Duplicates" property. Set that to Yes.
That should solve your problem.

The other thing that you could do is setup a group header
on the ID field. The ID field should then be in that
header. Either solution should help with this.

I hope that helps!

Kevin
 
Øystein Sund said:
I need help with the problem described below. Please anyone!
I'd really be greatful for any help!


I wrote:
I've got a report that's supposed to have a listbox that looks up error
codes from a table that has a relation to another table. This list is
going to look up this based on an ID number from the other table.


Why in the world would you use a listbox in a report to lookup values in
anther table? Surely you have heard of sql? Why not just build a query and
join in that lookup value from the other table? If I have even 5 lookup
fields, I simply fire up the query builder and drop in the main table, and
then drop in the 5 extra tables. I then just join them all, and then drop in
the text description (in place of the ugly id). It is all done with the
mouse (of course, you want to use left joins...as some lookup fields many
not have a value). What could be easier. Then, in your report, you just drop
in the fields.
So my question is, when Access generates a report, is it possible to get
a value from each post it generates?

Not 100% sure what the above means.

If you are saying that you don't want the id repeated over an over, then
there is a number of options you can use to prevent the id from being
repeated. You can simply in the properties sheet for the "id" text box in
the report simply set the remove duplicates to yes, and the id will not
repeat.

Another great way is to use a sub-report, and set the can grow/can shrink
proprieties to yes if there is more then one value on the "many" side. (it
is not clear if you have a simple lookup, or you are tying to display the
"many side". If you are trying to display the "many" side, then a sub-report
is even better...but both approaches are workable).

However, in either of the above cases, I would consider it very lame to try
and use a listbox in a report for doing a lookup when you have things sql or
sub-reports at your disposonal.

Either of the above applies runs absolute circles around some lame MySQL and
PHP where you have to write reams of code.
 
Why in the world would you use a listbox in a report to lookup values in
anther table? Surely you have heard of sql? Why not just build a query and
join in that lookup value from the other table? If I have even 5 lookup
fields, I simply fire up the query builder and drop in the main table, and
then drop in the 5 extra tables. I then just join them all, and then drop in
the text description (in place of the ugly id). It is all done with the
mouse (of course, you want to use left joins...as some lookup fields many
not have a value). What could be easier. Then, in your report, you just drop
in the fields.


Thank you! I'll try this!
 
Kevin said:
Oystein,

Greetings. As I understand what your trying to do, you
have a query as the basis for your report and it does, as
it should bring back (in the case of you example) two rows
as follows:

ID Failcode
56 doa
56 dead

You want your report to display:

ID Failcode
56 doa
dead

If that is correct, open your reportin design view and
select the ID field. Open the properties window. You
should find a "Hide Duplicates" property. Set that to Yes.
That should solve your problem.

The other thing that you could do is setup a group header
on the ID field. The ID field should then be in that
header. Either solution should help with this.

I hope that helps!

I now have more to go on with, so thank you! I will consider wich of the
suggestions that would be best.


Sincerely
Øystein Sund
 
Back
Top