Michael<BR>What I do is this (and I don't claim any originality for this).
If the user presses Cancel I close the form. If he presses Ok I keep the
form open but make it hidden. The calling form gets control back in both
cases, so it tests for whether the form is open. If so it gets the value(s)
off the screen and then closes it. Here's some code:<BR><BR>DoCmd.OpenForm
"frmWhatever", , , , , acDialog<BR>If IsScreenOpen("frmWhatever") = True
Then<BR>  var = forms![frmWhatever].txtControl<BR> 
DoCmd.Close acForm, "frmWhatever"<BR>End If<BR><BR><BR>Function
IsScreenOpen(strName As String) As Boolean<BR>IsScreenOpen =
(SysCmd(acSysCmdGetObjectState, acForm, strName) = acObjStateOpen)<BR>End
Function<BR><BR>and behind the Ok button is
just<BR>Me.Visible=False<BR>--<BR><BR>HTH<BR><BR>Andy
Lacey<BR>http://www.minstersystems.co.uk<BR><BR><BR><BR>
<BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px;
MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">--------- Original Message --------<BR>From:
"Michael Brosdorf" <michael.broesdorf@web.de><BR>To: "Access
Developers discussion and problem solving"
<accessd@databaseadvisors.com><BR>Subject: [AccessD] Picklist<BR>Date:
31/07/03 09:42<BR><BR>
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2>Dear group,</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2>Now comes the problem: how do I get the selected value back to the
calling form? (</FONT></SPAN><SPAN class=843412909-31072003><FONT face=Arial
color=#0000ff size=2>When the user clicks OK, the form is closed. So the
calling form cannot read the value of the listbox or the
textbox.)</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2>Has anyone done something like that and help me
out?</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2>TIA,</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2>Michael</FONT></SPAN></DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=843412909-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV><BR><BR>
<HR>
<BR><FONT face="Courier New"
size=2>_______________________________________________<BR>AccessD mailing
list<BR><A class=autolink
href="mailto:AccessD@databaseadvisors.com">AccessD@databaseadvisors.com</A><BR><A
class=autolink href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>Website:
<A class=autolink href="http://www.databaseadvisors.com/"
target=_blank>http://www.databaseadvisors.com</A><BR></FONT></DIV></BLOCKQUOTE>