Solved

List box row source query not picking up form reference

Posted on 2006-11-28
3
234 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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

910 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

22 Experts available now in Live!

Get 1:1 Help Now