List box query report question

S

sib

I'm extremely new and learning as I go. Please make any answer simple (or as
much as it can be).

I have a form that uses a value list to get addresses from a table. I want
to be able to print a report that will first allow the user to select from
the value list (addresses) and then print all products going to that address.


Any help would be appreciated.
 
S

scruffy

You first need to set your list box selections to strSelected and build a
description of them. Then assign their description to OpenArgs (it will carry
the info over to your report)

Good example is on Allen Browne’s website http://allenbrowne.com/tips.html

After you get your selections and descriptions built. Then in your report
add a text box and set it to Visible=False with the controlSource = OpenArgs.
Then in the OnOpen event of the report your code you would look like
this.(1stField, 2ndField, etc. are the sort order you want for the records)

Private Sub Report_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me.OrderBy = "[1stField] & [2ndField] &… [nthField]"
Me.OrderByOn = True
End If
End Sub

HTH,
Scruffy
 
S

scruffy

I forgot to include that the text box on the report should go in the report
header section.

scruffy said:
You first need to set your list box selections to strSelected and build a
description of them. Then assign their description to OpenArgs (it will carry
the info over to your report)

Good example is on Allen Browne’s website http://allenbrowne.com/tips.html

After you get your selections and descriptions built. Then in your report
add a text box and set it to Visible=False with the controlSource = OpenArgs.
Then in the OnOpen event of the report your code you would look like
this.(1stField, 2ndField, etc. are the sort order you want for the records)

Private Sub Report_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me.OrderBy = "[1stField] & [2ndField] &… [nthField]"
Me.OrderByOn = True
End If
End Sub

HTH,
Scruffy


sib said:
I'm extremely new and learning as I go. Please make any answer simple (or as
much as it can be).

I have a form that uses a value list to get addresses from a table. I want
to be able to print a report that will first allow the user to select from
the value list (addresses) and then print all products going to that address.


Any help would be appreciated.
 
Top