Well, there are two options.
For simple scenarios you can use the InputBox() function, which allows you
to collect a single value from the user:
varMyInput = InputBox("A user prompt","A title for the InputBox", "A
default value")
For more complex scenarios, you will have to create your own custom form.
How you call that form into existence depends on your preference, and there
are two options:
Firstly, you can call the form using the standard DoCmd.OpenForm method and
setting the WindowMode argument to acDialog.
DoCmd.OpenForm "frmMyDialog", , , , , acDialog
In your custom dialog, provide a command button to "close" the form. What
what it should actually do is set the form's Visible property = False,
rather than close it.
Private Sub cmdClose_Click()
Me.Visible = False
End Sub
Then immediately following the OpenForm code, you write code to extract the
data you want from the (now hidden) dialog, and close the form.
Me!txtSomeTextbox = Forms!frmMyDialog!txtSomeOtherTextBox
DoCmd.Close acForm, "frmMyDialog"
Secondly, you can instantiate the form using object-oriented techniques. See
the following website for information about how to do that:
http://www.pacificdb.com.au/MVP/Code/MyDialog.htm
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia