• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 651
  • Last Modified:

MS Access 2010 - pass a variable from a Listbox to report

In a database that I created, there is a form called "Select Learner" with a list box called "Full Name".  I want to use the selection in the listbox as filter to run a report.  I have tried using the following criteria in the query for the report to filter but when the query runs I get an "Enter Parameters Value" popup.

[Form]![Select Learner].[Full Name]

 It appears that listbox value is being passed as null

How can I accomplish this?
0
jrayos1976
Asked:
jrayos1976
  • 3
1 Solution
 
mbizupCommented:
Need an "s" on form:

Forms![Select Learner].[Full Name]
0
 
mbizupCommented:
And depending on how you are using it, possible an exclamation point before Full Name:

Forms![Select Learner]![Full Name]
0
 
jrayos1976Author Commented:
It is till not working.  I tried an exclamation point as well.  Before runnig the query do I need to perform a save function once I select a value from the listbox.  The reason I ask, is everytime i open the form  nothing is selected.
0
 
mbizupCommented:
If your listbox is bound to a field in the underlying table or query, possibly.

Can you post a sample of your database?
0
 
Nick67Commented:
Put this in the Report_Open event of the report with the problem

Private Sub Report_Open(Cancel As Integer)
MsgBox nz(Forms![Select Learner]![Full Name], "It thinks the listbox value is null!")
End Sub

If it thinks it is null, then you have a problem with something deep-sixing your listbox's value before the report even opens.
If you get a value, then your query isn't contructed correctly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now