473,396 Members | 1,722 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,396 software developers and data experts.

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

1
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 5188
Stewart Ross
2,545 Expert Mod 2GB
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
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...
2
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...
2
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...
9
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...
11
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...
11
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...
4
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...
7
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...
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.