473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Using VBA to toggle from MS Word to MS Access?

Access 2003, Windows XP SP2

I have an application that generates a word document populated with a
variety of fields from Access tables.

The word document is generated when the user presses a button
(cmdGenerateAgreement) on a form (frmTransaction).

I want the process to work as follows:
1. User presses button
2. Word document is opened and populated
3. Access screen becomes visible with a message box
4. User presses Ok
5. Word screen becomes visible for finalization

My question is how do I achieve steps 3 and 5?

I've tried SetFocus, Access Web's API: Manipulate Window
(fSetAccessWindow), and a lot of browsing in the newsgroups. Nothing
seems to work.

My guess is that this functionality will require a call to the Windows
API. I've read all the relevant sections in my Access books, and
nothing specific to this situation is mentioned.

Can this functionality be accessed using VBA? If so, any help or
direction would be appreciated. If not, can anyone think of a work
around?

Thank you,

Kelii
Aug 25 '08 #1
4 2476
My super easy merge does all 5 steps...and you can "enable" ANY screen for
merge with ONE line of code....

The sample I have can be found here:
http://www.members.shaw.ca/AlbertKal.../msaccess.html

What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....

Thus, each time you build a new form, you can word merge enable it with
great ease.

Make sure you read the instructions from above, and you should eventually
get to the follwoing page
http://www.members.shaw.ca/AlbertKal...rge/page2.html
Note that the merge can also use a query, and thus you don't have to merge
just "one" record..

After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).

Give the above a try.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Aug 25 '08 #2
Kelii <ke****@yahoo.comwrote:

Albert's code works very, very nicely.
>5. Word screen becomes visible for finalization
API: Find out if an application is currently running
http://www.mvps.org/access/api/api0007.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Aug 26 '08 #3
Albert / Tony,

Thanks for the links, I'll give it a try and report back.

Best,

Kelii
Aug 26 '08 #4
Tony - I was able to copy and paste the code from Access Web right
into a module and use it as is.

I did read the code and I do have some understanding of the API calls
referenced in the module.

I am very grateful to both you and Albert for your suggestions, big
thank you :D

Albert - Thanks for the splendid suggestion, my issue was more around
getting the Access screen to become visible once the bookmarks were
populated, then toggle back to Windows once the Ok button was selected
in Access. In addition, the Word document I'm using is fixed, so the
user doesn't have to mess around with populating the Word document
with bookmarks.

Thanks again to you both,

Kelii
Aug 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
3
by: Noozer | last post by:
I have several tags on a webpage of the same class. If the user clicks a specific checkbox I'd like to be able to alter the display property of the class, affecting all objects of that class. ...
13
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
2
by: Mel | last post by:
Hi, is there any way I can implement toolstrip toggle button simular to the MS Word alignment button? if one toggle button already pressed down, if user click on the "pushed down button", the...
50
by: sksoule | last post by:
Hi, Can anyone please tell me how to toggle a nth bit. For example, I am having a variable which is of 8 bits. I want to toggle the nth bit. Regards, Santosh
1
by: swiftouch | last post by:
I'm getting an error message in FF2.0: document.getElementById(toggle) has no properties The goal of the script is, when I hover my mouse over an image, to make one div element visible while...
2
by: Chuck | last post by:
How can I make an array of command buttons (or toggle buttons) on a form and have a text box on the same form display the index of the button clicked? This works very well in VB6, but I can't...
0
by: ARC | last post by:
Hello all, In access 2007, it appears you cannot put a toggle button underneath a menu id and have it show a Pressed / Not Pressed status. If you make the toggleButton ID as part of the main...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.