Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt user for several data

Status
Not open for further replies.

thromada

MIS
May 10, 2004
30
US
Hi all,
If I want to prompt for several pieces of information like for example, a date, a last name, and an amount... and then return that input to the original form, what do I use to do that? Do I use a subform? Or an inputbox? For example, I imagine that what would happen when the button "Input" On Click event is run is a dialog form would open with 3 fields as above, the user would enter the information and click OK, then whatever they entered is available in the calling form to work with. I don't know if I need Public variables to do this or if it's even a form I open with some type of passable parameters.
Thanks,
Tom.
 
How are ya thromada . . . . .
[blue]I imagine that what would happen when the button "Input" On Click event is run is [blue]a dialog form would open with 3 fields as above[/blue], the user would enter the information and click OK, then [blue]whatever they entered is available in the calling form to work with.[/blue][/blue]
You've already described a method you can use.

Since you [blue]query more than one value[/blue], a [purple]seperate form[/purple] for input would do nicely. You could [blue]do all your validation here[/blue], and it would look better and more professional than [blue]three InputBoxes popping-up in your face[/blue].

Only real important thing here is to use [purple]acDialog[/purple] in the [blue]Docmd,OpenForm[/blue] method. This stops your code from running until you close the [blue]called form[/blue], allowing complete data entry & transfer to the [blue]calling form[/blue] before the code continues. The call should look like this:
Code:
[blue]DoCmd.OpenForm "[blue][b]CalledFormName[/b][/blue]", acNormal, , , , [purple][b]acDialog[/b][/purple][/blue]
As for storing the data, it appears you need to [blue]hold the data[/blue] at least [blue]for as long as the calling form is open[/blue]. For this, I would pass the values from the [purple]called form[/purple] to three hidden (Visible property = Yes) textboxes on the [purple]calling form[/purple], [blue]where they reside for your use[/blue]. In the [purple]called form[/purple], pass the data back to the [purple]calling form[/purple] like so:
Code:
[blue]Forms!CallingFormName![purple][b]NonVisibleTextBoxName[/b][/purple] = Me!TextBoxName[/blue]

Calvin.gif
See Ya! . . . . . .
 
lupins46,

The reason is for data validation, as TheAceMan1 pointed out. I didn't clearly state that in my original post. I want to open a form and prompt for input of several things and then validate that input before the user can continue in the original form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top