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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Position of Pop up forms 1

Status
Not open for further replies.

NewTexican

Technical User
Dec 10, 2004
95
0
0
US
I have a book on VBA that tells me to do things that VBA in in my Access can't do. I guess Access comes with a slimmer version? Is it possible to state the exact position you want a pop up form to pop up to?
 
VBA is used in each of the Office programs, as well as in other products by both Microsoft and some ISV's (Independent Software Vendors). The version of VBA in Access (2000 or later) is exactly the same as in Excel, Word, etc. What's different is the "host application object model".

The VBA language by itself has very little support for the user interface, and although it has some rudimentary support for files, it has no understanding of file types (.doc, .xls, .mdb, etc.). These things are provided by the host application (Word, Excel, and Access, etc.) in what is called the "object model" for that application. For example, the Word object model provides objects for accessing documents and ranges (for processing .doc files) and the Microsoft Forms package (for user interface). Excel has the same Forms package, has but its own objects for accessing workbooks (.xls files). It also has an object for accessing ranges, but since worksheet ranges are very different from Word document ranges, it's entirely different from Word's range object. Access has a document object (but it's purpose is not related to accessing an .mdb file), but no range object, and has its own built-in forms for user interface.

VBA can be used to create generic functions that will work in any object model, but any considerable piece of VBA that actually interacts with a user or modifies data files will be written to expect an object model provided by the host application. Since your book is about generic VBA, it probably provides examples that will only compile in a specific host application, and the book should explain that to you somewhere.

To control where a popup window is positioned using VBA, check the DoCmd.MoveSize method or the MoveSize macro action.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
thanks peoples, that's exactly what I was looking for I didn't know about the movesize method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top