A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I open form and wait from VB Script



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2006, 07:07 PM posted to microsoft.public.access.forms
foobar
external usenet poster
 
Posts: 2
Default How do I open form and wait from VB Script

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


  #2  
Old August 19th, 2006, 07:11 PM posted to microsoft.public.access.forms
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default How do I open form and wait from VB Script

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 he
http://www.members.shaw.ca/AlbertKal...log/Index.html

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada



  #3  
Old August 19th, 2006, 11:09 PM posted to microsoft.public.access.forms
foobar
external usenet poster
 
Posts: 2
Default How do I open form and wait from VB Script

Thanks. EXTREMELY helpful and right on point.

Daniel


  #4  
Old August 19th, 2006, 11:56 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default How do I open form and wait from VB Script

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.

foobar wrote:
Thanks. EXTREMELY helpful and right on point.

Daniel


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200608/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.