Solved

List box row source query not picking up form reference

Posted on 2006-11-28
3
247 Views
Last Modified: 2010-05-18
Hi

I have a list box on a sub form.  The criteria for the row source query of the list box is set to the value of another control on the sub form as follows:

[Forms]![frmCompanies]![chdAddresses]![txtCompanyAddress_ID]

The problem is that no values are being displayed in the list box when they should be.  I have checked all the obvious.  If I substitute the above for an actual value then it works fine.  I have had this problem before but never been able to solve it - I have used the identical setup in other dbs and it has worked fine.  I can only conclude it is some sort of bug.

I am using Access 2003 on XP Pro

Any ideas??

Many thanks

Ken
0
Comment
Question by:kenabbott
[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 Comments
 
LVL 17

Accepted Solution

by:
Natchiket earned 500 total points
ID: 18026506
It may the way you are formulating the reference to the field

[Forms]![frmCompanies]![chdAddresses]![txtCompanyAddress_ID]

try

[Forms]![frmCompanies]![chdAddresses].Form![txtCompanyAddress_ID]

Where chdAddresses is the name of the subform on frmCompanies and txtCompanyAddress_ID is the name of the field within the subform
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 18026773
" I have checked all the obvious."

sorry to repeat, but have you checed the list control format to ensure that its column widths are not set 0cm;2.54cm...

effectively hiding the 1st columns.

that always catches me if i use the wizard to create the control, and  it autohides the key column and then i later chang emy mind about the number and order of columns.
0
 

Author Comment

by:kenabbott
ID: 18026794
Fixed!  Adding the .Form! before the control name did the trick.  many thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

632 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