[AccessD] creating an inputbox form

Heenan, Lambert Lambert.Heenan at AIG.com
Wed Jul 23 12:36:41 CDT 2003


The trick is that after the user selects something (from a combobox?) and
then clicks the "Ok" button the code behind the button should NOT close the
form. Rather it should set the form's visible property to false. Then the
caller can access the control on the (still loaded but invisible) form,
retrieve the selected value and the close the form. To make life simple, you
want to wrap all the required actions in a function (just as MsgBox is a
function that does all the hard work for you). Something like this...

Function MyInputBox(whatever parameters you need) as SomeDataType
Dim MyReturnValue As SomeDataType
...
	DoCmd.OpenForm "YourForm",,,,,acDialog,"Any OpenArgs you need to
pass in"
	' the "acDialog" halts code execution in this function
	' until the form closes or is made invisible
	MyReturnValue = Forms("YourForm").SomeControlOnTheForm
	DoCmd.Close acForm ,"YourForm"
	MyInputBox = MyReturnValue 
End Function

Lambert

> -----Original Message-----
> From:	Don Elliker [SMTP:delliker at hotmail.com]
> Sent:	Wednesday, July 23, 2003 12:40 PM
> To:	accessd at databaseadvisors.com
> Subject:	[AccessD] creating an inputbox form
> 
> Howdy,
> 
> I want to use my own form in place of the Inputbox. I am stuck on the part
> where, after a user selection, I return the value selected. It's like
> this; the user is on a form, makes a selection and up pops (my) inputbox.
> they pick something and close it. How do I know what they picked?
> TIA,
> 
> _d
> 
> 
> 
> 
> "Things are only free to the extent that you don't pay for them".-Don
> Elliker 
> 
>   _____  
> 
> MSN 8 helps ELIMINATE E-MAIL VIRUSES.
> <http://g.msn.com/8HMRENUS/2743??PS=>Get 2 months FREE*. << File:
> ATT15943255.txt >> 


More information about the AccessD mailing list