?
Solved

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

Posted on 2011-09-12
5
Medium Priority
?
626 Views
Last Modified: 2012-05-12
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
Comment
Question by:jrayos1976
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 36523700
Need an "s" on form:

Forms![Select Learner].[Full Name]
0
 
LVL 61

Expert Comment

by:mbizup
ID: 36523718
And depending on how you are using it, possible an exclamation point before Full Name:

Forms![Select Learner]![Full Name]
0
 

Author Comment

by:jrayos1976
ID: 36524288
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
 
LVL 61

Expert Comment

by:mbizup
ID: 36524397
If your listbox is bound to a field in the underlying table or query, possibly.

Can you post a sample of your database?
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 total points
ID: 36525562
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

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question