Solved

Change subform based on a listbox on main form ACCESS 2003

Posted on 2013-05-10
2
886 Views
Last Modified: 2013-05-10
I have a parent form that displays customers by their Tax ID's.  However, one tax ID can have several names attached to it.  As I change the combo box Tax IS, the listbox with all the names changes to display those that are associated with this Tax id.  This part is fine.  However, there is a sub-form ont his main form that, as the NAME in the list box changes, I want the subform to display teh details for that name.  So, the subform is not really associated with teh TaxID, is is associated with the names (with their Key ID)  in the LIst box.  How can I update the subform based on the NAME key id, not the main  form's Tax ID?

Sandra
0
Comment
Question by:ssmith94015
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39156762
filter the record source of the subform using the [Name] field taken from the listbox.

me.subformcontrolname.filter="[Name]=" & chr(34) & me.listboxname & chr(34) & "
me.subformcontrolname.filteron=true

you cna do this in the after update of thelistbox

also try this format

me.subformcontrolname.form.filter="[Name]=" & chr(34) & me.listboxname & chr(34) & "
me.subformcontrolname.form.filteron=true
0
 

Author Closing Comment

by:ssmith94015
ID: 39156821
Excellent.  Much simpler than I thought it would be.

Sandra
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

Title # Comments Views Activity
Field behavior for "locked" form 12 29
Run Time Error 3075 15 44
Getting Run-Time Error 13 - Type Mismatch 3 27
Access Excel export not behaving 2 25
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

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