Solved

List box row source query not picking up form reference

Posted on 2006-11-28
3
233 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
3 Comments
 
LVL 17

Accepted Solution

by:
Natchiket earned 500 total points
Comment Utility
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
Comment Utility
" 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
Comment Utility
Fixed!  Adding the .Form! before the control name did the trick.  many thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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 …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now