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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box selection to report.

Status
Not open for further replies.

Laguerrepj87

Technical User
May 13, 2011
36
US
Hey I have a form that has some calculations in them and combo boxes that you can select multiple things. How would i get the calculation to show up on my report? And how would I get the combo box selection to show up on my report?
 
ok the message went away. i did something wrong. it works but it doesn't show the other feilds it just show the RiskCodes it does show the Risk meaning it only show the one column not both. now do i fix that.

In the table i have the Risk code ex h100

and the next column i have what it means.

ex child is over weight by 25%.

how do i get it to show up in the report as

Risk- H100 - Child is over weight by 25%
 
Now that i read what you wrote i got it to give me multi selections (sorry about that )

the second thing is. its not showing Both Columns. how do i get that to work.
 
To get the different columns (whatever number) you have to modify the code to work with different columns. Change the code to
Code:
Option Compare Database
Option Explicit

Function GetListBox(WhichControl as Control, WhichItem As Integer, [b]WhichColumn as Integer[/b]) As String
With WhichControl
   Select Case WhichItem >= .ItemsSelected.Count
     Case True
        GetListBox = ""
     Case False
        GetListBox = .Column([b]WhichColumn[/b], .ItemsSelected(WhichItem))
   End Select
End With
End Function
and 'request' the information with:
Code:
=GetListBox(Forms!MyFormName.MyListBox,0,[i]WhichColumn[/i])
By now you should be able to play with the numbers to get the exact results you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top