f



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
0
keliie (60)
8/25/2008 3:23:26 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

4 Replies
1310 Views

Similar Articles

[PageSpeed] 36

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/AlbertKallal/msaccess/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/AlbertKallal/wordmerge/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
pleaseNOOSpamKallal@msn.com


0
8/25/2008 4:39:37 PM
Kelii <keliie@yahoo.com> wrote:

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/
0
ttoews (2789)
8/26/2008 12:52:19 AM
Albert / Tony,

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

Best,

Kelii
0
keliie (60)
8/26/2008 3:03:05 PM
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
0
keliie (60)
8/27/2008 1:16:22 AM
Reply:

Similar Artilces:

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but...

Possible to keep MS Access interface and migrate the MS Access to MS SQL Server?
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to migrate the backend database from MS Access 2000 to MS SQL Server 2000. However, I want to keep the MS Access 2000 interface. Would it be possible? If I migrate the MS Access to SQL Server, would the queries, back-end VBA, macro, tables and forms be affected? Do I need to change the MS Access data type to SQL server supported data type? Which tool I can use to do the migration? Upsizing wizard or exporting...

How to access data from an MS Excel sheet and import it to a MS Word using LabView?
Hello I would like to know how is it possible to access a specified data( for example row 1 ,column 2 to 5) in an Excel sheet and import it to a word document using LabView. Thanks You can interact with Office application through ActiveX, but you should be warned that it requires opening a lot of properties and going deep into the Office object hierarchy and this does not look nice in LabVIEW. If you open the example finder (Help&gt;&gt;Find Examples) and search for "ActiveX" or "Excel" you should find some examples on the basics of working with Excel. You can do the same with Word, so you can get your data from Excel and put it into Word. If you search here you should also find some threads dealing with this. To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. <a href="http://cnx.rice.edu/content/col10241/latest/" target="_blank">Here</a>, <a href="http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/55974411828f779086256ce9007504bd" target="_blank">here</a>, <a href="http://www.mech.uwa.edu.au/jpt/tutorial/index.html" target="_blank">here</a>, <a href="http://www.iit.edu/~labview/Dummies.html" target="_blank">here</a> and <a href="http://www.upscale.utoronto.ca/GeneralInterest/LabView.html" target="_blank">here</a...

How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde).
How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde). Everytime i click the command button to merge the data, it gives me item not found and i know that its a problem with my datasource. when i click ok then it opens the word doucment prompting me which datasource you want to use, when i click DDE then it gives me the merged data. Is there anyway i can set it permanantely in my codes below. Private Sub SetQuery(strQueryName As String, strSQL As String) On Error GoTo ErrorHandler 'set the query from which the merge ' document will pull its i...

Accessing MS ACCESS database using Data Environment
HI, I have developped a program in Visual Basic 6.0 using MS Access database. I have created all my reports through Data Environment where I have entered the location of my database file (for e.g c:\project\app\test.mdb) in the Connection properties. I have installed my application on another PC using Package & Deployment wizard. When viewing the reports on the other PC, I have to enter everytime the new location of the database. How can I solve this problem, please? nadia wrote: > HI, > I have developped a program in Visual Basic 6.0 using MS Access database. >...

Inserting value from MS Word into MS Access
If there are any enlightend souls out there that can help me, I would greatly appreciate it. I would like to use a macro to take a value and add it to an access database. I am having a problem with the very first line of code, Dim myDatabase as Database, the system does not recognize the Database object. PLEASE if there is anyone out there that has a piece of code that sends info from a word file into a access database... send it to me. I will Love you forever. Evan wrote: > If there are any enlightend souls out there that can help me, I would > greatly appreciate it. I would like to use a macro to take a value and > add it to an access database. > > I am having a problem with the very first line of code, > Dim myDatabase as Database, the system does not recognize the Database > object. Add a reference to DAO or use an Object variable and late bind it (set db=CreateObject("DAO.Database"), although the first way will give you intellisense. -- \\\\\\ \\ \\ Windows is searching \ \ For your sig. \ \ Please Wait. \__\ mmm, I am sorry - I am really new at this... I have added the ADO reference, and I want to execute this SQL - "insert into documents (title) values ('testTitle')" How do I write the actual code, I had it before but then I deleted the wrong file... now I am back at square one Evan wrote: > mmm, I am sorry - I am really new at this... I have added the ADO > referenc...

Importing MS Access data into MS Word
In the thread "combining multiple address fields into 1 address field", Stuart (?) helped solve that problem. I then tried to set up a mail merge in Word to check how I could use and merge the data. I found the database tool bar and opened the appropriate database - but... I could not find a way to open a particular table or query in order to insert the fields from the query into Word. The procedure I followed was this: - open a blank word .doc - from the database tool bar selected "insert database" - a window opened, headed 'Database' and divided into 3 sec...

How to get Graphs from MS Access and use them in MS Powerpoint
Is there any easy way how to use graphs created in MS Access 2000 in Powerpoint?Especially when I need to use about 20 of them. Is there any development in Office 2003? Oskar *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Instead of creating the graphs in Access, perhaps you should use vba either (a) to open Powerpoint from within Access and create the graph by pushing data into a Powerpoint template of your own design or (b) start Powerpoint and open the Access database in code and pull the data into a graph. Eith...

copying data from MS-SQL to MS-Access using VB.Net
Hi there, I'm trying to use MSAccess as a "container" to move data around from one MS-SQL server DB to another. This is basically already a design decision that has been made for a lot of reasons and can't be changed by me. What I was wondering is what is the bet way to populate the MS-Access DB. The DB will only contain 6 tables which will have a very small amount of data in them. I have tried to use ADO.Net to read the data from MS-SQL into a DataTable and then save it into the MS-Access DB using again using a DataTable populated from the first, but I can't seem to ge...

Emailing Survey Through Lotus Notes (Surveys Generated in MS Access/MS Word)
I'm not sure if I have the right newsgroup, so please be kind. I have a MS Access database that generates surveys to send to employees. It creates the surveys based on a MS Word template. Each survey is saved as a separate MS Word doc. Instead of having the user copy and paste text from the MS Word doc to a new lotus notes email, I would like to send the surveys directly to Lotus Notes and save them as drafts. That way, the user could open the draft, ensure nothing's wrong, and then send it. I have the VB code to send a Lotus notes email and it works (no APIs). My que...

Access MS-ACCESS database on server from client????
I m currently developing a java based application and want to know how can i make client access database located on the server? "HeMan_Speaks" <Lunar20092010@gmail.com> wrote in message news:d71ce567-0434-48b8-b1d2-bb191706ab45@w8g2000prd.googlegroups.com... >I m currently developing a java based application and want to know how > can i make client access database located on the server? I think you're going to have to expand a little bit more in your question here, as is not 100% quite clear what you're trying to do. You might want to make a little bit of a distinction between MS access, the development system that allows you to write code, build forms, and build reports, and that of the database engine that you choose to use with MS access. When you build an application MS access, you then choose your database engine, that might be oracle, SQL server, or perhaps more often leave the default jet database. So when you say make a client access application, are you talking about a piece of software that you plan to install and each computer? The fact that your introducing the issue of java further complicates your question. Perhaps your question is simply you have some java code running on a server, and with to open a mdb file (an access database file). In this situation you're not really using MS access at all here (you using what is called the jet database engine to read that mdb file). For all the trouble in this type of sce...

Access needs to be installed for me to use MS Access
Hi, Is it required for MS Access to be installed on machines on which I need to deploy windows app which uses MS Access as its backend. If no then how do I access and wrie to access database? Thanks, Vikas. <vikassah@gmail.com> wrote in message news:1166161668.556801.183030@n67g2000cwd.googlegroups.com... > Hi, > > Is it required for MS Access to be installed on machines on which I > need to deploy windows app which uses MS Access as its backend. If no > then how do I access and wrie to access database? If Access, or the Access runtime (from the developer extensio...

request for explanation on access an database in ms access
This is the code that I found on the internet for accessing an ms access database: import java.sql.*; class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // set this to a MS Access DB you have on your machine String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end // now we can get the connection from the DriverManager Connection con = DriverManager.getConnection( database ,"",""); } catch (Exception e) { System.out.println("Error: " + e); } } } What I don't understand is the declaration of database. What I did was putting the database in the same dir as the sourcecode and use "jdbc:odbc:CafeJolt.mdb". But this doesn't work. And the above code does, why is that??? Actually it's not Java question. It's ODBC question. You have to have ODBC connection. Depending of Windows it's usually something like this (for my Windows 2000): Start->Sttings->Control Panel->Administartive Tools->Data Sources(ODBC)-> User DSN -> [Add]-> Driver to Microsoft Access(*.mdb) === And here, finally you can choose file name. ...

Accessing MS-Access from OpenRoad using ActiveX
Hi I'm wanting to conect to an MS-Access MDB file from an OpenRoad program using ActiveX. Can someone tell me the files I need to use/register for Windows XP? Any other help or suggestions would be most appreciated. Darren dharvey911@hotmail.com ...

MATLAB command to access MS Access database
Hi! Is there a MATLAB command which gives access to a .mdb MS Access database or do I need a special driver? Thanks, Andree Hi Andree Ellert, you can use activeXcontrol to interact with MS-Access database. access = actxserver('Access.Application'); returns the handle for Access. set(access, 'Visible', 1); will show the opened Access window. use get(access) and set(access) commands to find the methods available to call. -Vadivelu M =========== http://www.mathworks.com/access/helpdesk/help/toolbox/database/datatool.shtml "Andree Ellert" <ellert@gmx.net/////\\\\\> wrote in message news:eed9874.-1@webx.raydaftYaTP... > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree Andree Ellert wrote: > > > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4045&objectType=file> -Hardik ...

Import MS Office Excel Comma Separated Values Files into a MS Access 2003 database
Hi, I have been tasked with Importing MS Office Excel Comma Separated Values Files into a MS Access 2003 database. These files were exported from a DB2 database.I have also been given the DDL code. I have Googled a solution to this task and have tried creating these tables using the DDL code in a query within a blank MS Access database. Is there a more expedient way to achieve this? I noticed, for example, that a field in DB2 has a data type of "decimal" while the same field would have the data type of "number". Thanks, Zuf What follows is the DDL: -------...

Best way to access a remote MS ACCESS database
What is the best way, via the internet, to access a remote Microsoft Access database? I was thinking of using VPN, but I thought that I would check here to see if there is a better way. Any suggestions? Thanks Do you mean remotely controlling an Access database, or linking tables over the internet? The first is doable, the second is a recipe for disaster. Remote Control: If your remote OS is Windows XP, you can use Remote Desktop (although only 1 person can access the PC at a time; this will change in the upcoming Service Pack for XP, but that may not help you now). Otherwise, GoToMyPC offers similar services, as does Terminal Server (a component of a Windows Server machine), PCAnywhere, et al. Linking to remote tables: You will almost certainly encounter severe problems with corruption, and your performance will almost certainly be so poor as to be unworkable. I attempted this once, with a web server in Canada and my machine in Augusta, GA. Even tiny data requests on a very well optimized data structure took waaaay too long to process ... it's simply not workable, IMO. Other alternatives would be covert the app to a web-based and place your data on a web server. Access/Jet isn't really designed for those workloads, but running a small site with minimal transactions and users can be done. Otherwsie, consider switching to a more robust data platform like MySQL, SQL Server, etc. -- Scott McDaniel CS Computer Software Visual Bas...

Accessing a MS Access database across two servers
Hi The technical support guys at my company have set up my system so that the server containing the MS Access database is on one server, while the pages that should access the database are on another server. When the pages and database are on the same server, I usually just connect through ODBC. The problem is that I don't know how to set up an ODBC connection to link from one server to a database in another. Anyone know what I am getting at and know of a possible solution, or a link to a site which may help. thanks in advance Brendan "Singularity" <Brendan.Collins@Sin...

exporting data from ms access to ms project
Im wondering if any on can help me to export data out of an ms access database into ms project 2002. I want to export a start date and completion data of different projects, which is stored in the database. I think this process can be done invisible to the user, so that when they enter the data into access and save it, it will automatically create a project schedule in ms project, which they can refer to at a later date in the application. I would appreciate if any one can give me any advice on this matter, i.e. VBA code etc or good web sites etc that may be of use. Regards Rob McC, England ...

Using Iseries Access ODBC Driver with MS ACCESS 2003
When Trying attaching databases into MsAccess2003 using Iseries Access ODBC Driver (I'm in OS400 v5r2) I get an error message according to which the duration of connection is too long and so I can't attach the database although I got the list of the tables in the library I specified. Can anyone help me ? Thanks in advance. The timeout to dispay de data is small. You need to increase this timeout. The problem can occur when the tables are very very very (but very) big. "Bertrand Bard" <bbard@dehon.com> escribi� en el mensaje news:d01a5cc.0404280030.58f11d3e@posting.go...

How to access MS Access from Perl?
Hi, Good day! I am writing some Perl script on the server side for HTML forms that can create/update an MS Access database. Does anyone know of examples how this can be done? Your help is greatly appreciated. -lc Email to luican@yahoo.com bounces. Anyway, try DBI and DBD::ODBC. Or maybe DBD::ADO, but I've never tried it. ---------------------------------------- http://cpan.org http://search.cpan.org/~jurl/DBD-ODBC-1.09/ODBC.pm ... Connect without DSN The ability to connect without a full DSN is introduced in version 0.21. Example (using MS Access): my $DSN = 'driver=Mi...

Use of Access 2002-2003 structure in MS Access 2007
Dear reader, Is it possible to run in Access 2007 an application designed in Access 2002-2003 format? Tanks for any assistance. Kind regards and all the best for 2009 Simon ...

Accessing 2 tables having same name but different databases ms-access
Hi, I have an application with MS-Access as backend and JSP/ tomcat as frontend/webserver. For getting better response time(as access is very slow compared to other RDBMS's), I have split the main DB into two DB's on different disks on my server for better performance.I have kept the table names same but changed the DB names. How do I access tables from both the DB's? This is what I have done; I made different connection to the respective DB's i.e. con and con2. When I want to access data, I am using 2 result sets for retriving data from the tables, but getting no result. Here is my code: rs2_1=stmt2_1.executeQuery("select * from Requests where Status='Released' AND LoginName='"+login+"' order by Req_No"); rs=stmt.executeQuery("select * from Requests where Status='Released' AND LoginName='"+login+"' AND Req_No> 5500 order by Req_No"); So, rs & stmt are for latest records and rs2_1 & stmt2_1 correspond the records from older DB. I think, I'm forgetting some small thing but cant get it. Please advice. What do you mean "no result"? Does "next()" return false for both rs2_1 an= d rs? If you're really trying to improve response time, you should probably be ru= nning the two queries in separate threads ... but as you acknowledge, Acces= s may not have as high performance as other RDBMSs. You would also see rel= iability adv...

accessing MS Access database fila via ODBC problem
Hi! I'm trying to connect to a MDB file via ODBC like this: char *DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\dev-cpp\\test\\1.mdb"; SQLAllocEnv(&env); SQLAllocConnect(env, &hdbc); SQLBrowseConnect(hdbc, (UCHAR*)DSN, strlen(DSN), (UCHAR*)buf, BUF_SIZE, (SQLSMALLINT*)&rcvlen); The function SQLBrowseConnect fails and SQLGetDiagRec returns "IM001 Driver does not support this function" Can anyone help me? Thanks! David On S...

Web resources about - Using VBA to toggle from MS Word to MS Access? - comp.databases.ms-access

Local access and transport area - Wikipedia, the free encyclopedia
Local access and transport area (LATA) is a term used in U.S. telecommunications regulation. It represents a geographical area of the United ...

Facebook Expanding Access to Conversion Lift Measurement
Facebook launched conversion lift measurement in January 2015 with the goal of helping advertisers track conversions instead of clicks, and the ...

Planet OS Opens Access To Weather Data
... for software developers using weather data to power their apps, researchers and climate specialists enabling them to discover, access and build ...

Access your clipboard from any PC or Mac with 1Clipboard
1Clipboard is a free tool which enables sharing your clipboard contents with other PCs or Macs. The developer says that Android and iOS apps ...

Sci-Hub — Free access to every scientific paper ever published
Say what? How is it I only heard of this this week? Long story headlined "Should All Research Papers Be Free?" from the New York Times short: ...

US says losing access to China-claimed waters would be huge
CANBERRA, Australia (AP) — A U.S. Navy commander warned Wednesday that if the United States lost access to international waters claimed by China ...

MIT, Harvard researchers push new way for users to control access to personal data
Cryptography researchers at MIT and Harvard have developed software called Sieve that is designed to help users keep track of encrypted personal ...

How to access Google Drive files faster with Launch Center Pro
... Launch Center Pro has solved many workflow problems for me over the years. Most recently it’s been an immense time-saver when it comes to accessing ...

Cal Investigation Finds Assistant Coach Sexually Harassed Reporter Who Accused Him Of Trying To Trade ...
... a copy of Cal’s investigation into the matter, and even Hufnagel’s own statements make it appear that he attempted to trade sex for access, ...

Paragon's early access starts now, no more progress wipes
Paragon is gearing up for launch in the future, but for now, Epic is keen on putting it into an Early Access phase. The good news is that there ...

Resources last updated: 3/20/2016 4:09:42 PM