Selasa, 19 Juli 2011

RE: [MS_AccessPros] Re: How to update combo box list options when record changes (automating F9)

 

Heidi-

I assume the Row Source of the combo box has a reference to something like
[Forms]![MyOuterForm]![Category]. In the AfterUpdate event of the Category
control on the outer form, try putting:

Me.SubformControlName.Form!OutputUnit.Requery

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of creaturenutt
Sent: Tuesday, July 19, 2011 8:54 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: How to update combo box list options when record
changes (automating F9)

Hello,
I am looking to automatically update values in a subform combo box based on a
value in the main form. I'm finding that hitting "F9" will update the values,
but I would like to code it to do so automatically. So far I have tried a
number of "requery" and "me = []" options, but I either have not found the
proper event for the code to make it work, or I have the syntax written
incorrectly.

Here are the details:
The parent and child form are linked by "ID". The Subform has a combo box
control called "OutputUnit" which displays a list of values from a look-up
table. The control has two columns, the second of which I would like to equal a
value in the MAIN FORM named "AllOrgs.Category"

I am looking for suggestions on how to write this code correctly, AND where to
put it. There is a good deal of code already running, so "On Current" or "On
Open", etc may have some code that will need to come before or after if the
requery/refresh code needs to go in these events.

Thank you!
Heidi

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar