473,656 Members | 2,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using VB to transfer Access (XP) forms data to word doc

1 New Member
Here's my Q. I have a form in which users fill in text boxes and select checkboxes. After the form is completed, the user clicks the submit button which then transfers all to a word for editing, saving or emailing. My problem is trying get the checkboxes input to transfer to word and have the corresponding checkbox in word checked as well.

Can anyone suggest a solution?

Here is how I have been able to successfully transfer the text from the access form text field to a bookmark in the word doc.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Option133_click()  
  2. Dim objWord As Word.Application    '
  3. Start Microsoft Word.    
  4. Set objWord = CreateObject("Word.Application")    
  5. With objWord        
  6. 'Make the application visible.        
  7. .Visible = True       
  8.  'Open the document.        
  9. .Documents.Add ("\AWARD.frm.dot")                
  10. 'Move to each bookmark and insert text from the form.        
  11. .ActiveDocument.Bookmarks("Address1").Select        
  12. .Selection.Text = (CStr(Forms![frmPDocuments]![Address1]))        
  13. .ActiveDocument.Bookmarks("City").Select        
  14. .Selection.Text = (CStr(Forms![frmPDocuments]![City]))        
  15. .ActiveDocument.Bookmarks("State").Select        
  16. .Selection.Text = (CStr(Forms![frmDocuments]![State]))        
  17. .ActiveDocument.Bookmarks("Zip").Select        
  18. .Selection.Text = (CStr(Forms![frmPDocuments]![Zip Code]))
  19. End With
  20. End Sub
  21.  
  22.  
Jun 23 '08 #1
1 5221
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi. Correct me if I'm misinterpreting here, but the only way I can see of doing what you ask (to have checkboxes in Access represented correctly as checkboxes in a Word document) would be to have checkboxes in the Word document and set or clear their values using VBA code to do so.

The problem is that a checkbox is just the means for storing a boolean value (where -1 represents True/Yes/Ticked and 0 represents False/No/Not ticked). When the data is exported to Word it is the -1 or 0 which is transferred, not the graphical tickbox representation.

In a Word document you should be able to use the extended characters from the Unicode character set of your current font to output special characters such as the square root symbol to simulate a tick (using the unicode version of the Chr function, ChrW to do so), or if you are outputting to a table column formatted in Wingdings say you should be able to output one of the graphic characters representing a ticked or unticked box.

Other than that I can't think of how you could transfer a checkbox representation of a yes/no value from Access to Word.

-Stewart
Jun 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1240
by: Kathryn Prpic | last post by:
I created an mdb database for addresses, and now am having trouble using it. I don't have Access. I have Windows XP and am using Word. I want to import the database into Word so that I can print it. It was created using the same XP program.
2
1912
by: Shannon Rotz | last post by:
I have a function in a Microsoft Access module (below) which creates a Word XP Mailmerge document, drawing the data from Access XP. I can get the connection to work fine. However, when I create the form letters, the data from certain merge fields is missing. When I view the data in the MailMerge Recipients dialog box, the data is not there either - the columns are there, but the records have blanks where the data in those columns should...
2
4812
by: Ray Todd Jr | last post by:
Could someone please look at this code and tell me what I am missing, please? The problem that is occuring is I am given an error (5922) that states "Word was unable to open the data source" As an overview, I have a form where you can put the criteria to select the data you want to print the forms by, the form has runreport button witht he following code. When I click on the button, I get the above mentioned error. If I remove the...
9
3957
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it will not set the value of the control and will leave the checked status of the checkbox to false when a user selects a new date. this works fine when using the control on a win2k machine but if we use it on a win XP box and call
11
2967
by: Paul Tremblay | last post by:
Hi, I can't seem to locate the visual C++ (pre .NET) ng. This may be slight off topic here - please point me to the correct ng if it is. Without going into much detail (and repeating myself several times), I am using Visual C++ 6.0 to develop applications - *instead* of .Net. I am using the MFC to create my GUI components. I am particularly interested in doing the ff with my GUI:
11
6021
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it falls into an infinite loop and later a StackOverflow Exception. I need to do this and not a Response.Redirect or a transfer with the bool in false. My problem is that this KB is saying that this problem should be solved with ServicePack 1 of...
4
3519
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
7
33398
by: phillip.s.powell | last post by:
We're looking at a GUI interface for our MySQL DB and I am interested in MySQL Administrator, however, one of our requirements is to be able to import/export databases. Is this possible or do I need to know else (e.g. Navicat)? Thanks Phil
7
2022
by: JDOMPer | last post by:
Don’t misunderstand me – I use AJAX, but I think there is a far simpler, elegant alternative that just uses Javascript, the DOM and Php ( hence - JDOMP) for data transfers, and is cross-browser without the need for work arounds. JDOMP works in recent versions of Explorer, Mozilla, Safari and Opera. Please note I will not deal with security issues which are always an issue whenever there is access to a database. You can simply change text on...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.