Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report on value list? 1

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
is it possible to base a report on a string/array of values or does a report have to be based on a table/query?

what I'm trying to do is to generate the report on values which sit in a value list listbox, i.e. before they get inserted into a table.

thanks

--------------------
Procrastinate Now!
 
Put them into a temporary table?

Have fun! :eek:)

Alex Middleton
 
is there no way to avoid doing that?

I don't like temp tables floating about everywhere...

--------------------
Procrastinate Now!
 
The only other way is to put the list into a control, then refer a field on the report back to the control, e.g. form [Form1] containing the control [Text1] to put data into textbox [Text2] on report:

Text2 = [Forms]![Form1]![Text1]

I can't think of any other way of getting the data into the report.



Have fun! :eek:)

Alex Middleton
 
it's possible to reference individual entries on the listbox but I can't seem to get all the values of one column in the listbox...



--------------------
Procrastinate Now!
 
I think there is a way to loop through all the values in a listbox, but it eludes me at the moement. If I find it I will post it.

Have fun! :eek:)

Alex Middleton
 
Just wondering, how is the list poulated? If it is a value list, presumably this is entered manually, so why not just put the details straight into the text box?

Have fun! :eek:)

Alex Middleton
 
I haven't worked with it, but check the Print method in the help files. There's a sample there.

Perhaps using the Page event and "draw" the whole report - would mean some calculation, though. Measures are in Twips - some air code ...

[tt]const clngheight as long = 1000
dim lngCounter as long
for lngCounter = 0 to 10
me.currentx = 500
me.currenty = lngCounter = clngheight
me.print "Test#"
me.currentx = 2500
me.currenty = lngCounter = clngheight
me.print cstr(lngCounter)
next lngCounter[/tt]

Replacing the last line above with for instance

[tt]me.print str(forms!frmMyForm!lstMyList.Column(1, lngCounter))[/tt]

should also be doable ...

Roy-Vidar
 
Oups - two occurences of booleans, in stead of some simple math - sligth difference [blush]

[tt]me.currenty = lngCounter * clngheight[/tt]

Roy-Vidar
 
that looks very promising roy, will give it a try...

Alex, this is a ListBox, and the entries are not yet entered onto the database...

--------------------
Procrastinate Now!
 
I know, but you must have the values entered in the RowSource property of the listbox for them to show up.

Have fun! :eek:)

Alex Middleton
 
yes, but you can't use the rowsource as a valid control source on a report, at least I've not been able to figure out how...

--------------------
Procrastinate Now!
 
yes, roy's solution will work, all I have to do now is figure out all the heights and widths of everything...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top