Solved

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

Posted on 2011-09-12
5
609 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Database 5 47
Ms Access locate folder either this or that 2 34
Trying to export a table to another Access database file 2 17
Email question 12 20
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

733 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