Michael Brösdorf
michael.broesdorf at web.de
Fri Aug 1 05:04:48 CDT 2003
BerichtKath, thanks for your suggestion. Unfortunately the picklist form is called from several other forms. To make things more complicated, sometimes other things then updating a control on the calling form have to be done. In another application I passed a piece of code in the openargs to the called form an ran it from the OnClose event via the eval-function. But any proc/function called this way has to be public, which is not pretty either. So far, Andy's suggestion sound very appealing to me: Open the form from a public function as a dialog (that way the code 'waits' until the form is closed/hidden). The OK/Cancel buttons on the form hide the form, the function reads the selected value directly from the listbox on the hidden form, closes it and returns the selected value. Michael -----Ursprüngliche Nachricht----- Von: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]Im Auftrag von Software Design & Solutions Pty Ltd. Gesendet: Freitag, 1. August 2003 01:56 An: Access Developers discussion and problem solving Betreff: Re: [AccessD] Picklist Why not add an after update event on the called form to update a control on the master form before it is closed? Then you don't have to hide / unhide forms. Kath ----- Original Message ----- From: Michael Brosdorf To: Access Developers discussion and problem solving Sent: Thursday, July 31, 2003 7:38 PM Subject: [AccessD] Picklist Dear group, my application has a whole bunch of master data tables. I want to create a single form that allows me to pick one value from these master tables. So far, I pass OpenArgs to the form specifying from what master data table I want to pick a value. That works fine. The form basically consist of a listbox (to display the content of the specified master data table) , a textfield (to hold the ID of the selected entry), an OK- and a Cancel-Button. The form is opened as a dialog form (meaning it keeps the focus until it is closed). Now comes the problem: how do I get the selected value back to the calling form? (When the user clicks OK, the form is closed. So the calling form cannot read the value of the listbox or the textbox.) Has anyone done something like that and help me out? TIA, Michael ---------------------------------------------------------------------------- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030801/1856b119/attachment.html>