How do I open form and wait from VB Script

  • Thread starter Thread starter foobar
  • Start date Start date
F

foobar

While executing a VB script in Access 2003 I would like to "pop up a dialog
to get some user input" and then proceed with the script.

As far as I can figure out, VB Access does not support dialogs as such but
rather I build a Form that contains the various UI elements that I would
like to use to get the user's input.

How do I display the form and wait for the user to click Ok/Cancel on the
form?

The DoCmd.OpenForm returns immediately.

Do I have to build a "sleep" function that periodically wakes up to see if
the form has set a global variable "I Have been closed?".

What I'm trying to do is a build a glorified MsgBox to get more than just
Yes/No/Cancel from the user.

Daniel
 
If you just need the code to wait, then use input box



strAnswer = inputbox("please enter your name")

if strAnswer <> "" then
msgbox "Your name is " & strAnswer
end if


The above code does wait. If you want/need to ask MORE then one thing, then
you can use a form you build as a dialog form.

I explain how here:
http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html
 
Just so the record is straight, a WindowMode of acDialog will stop code
execution in the calling form until the form is closed or made invisible.
This is all covered in the VBA help on OpenForm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top