Go Back   Access World Forums > Apps and Windows > Word

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-18-2019, 08:05 AM   #1
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
exporting to word

Help,
exporting to a word document and any field that is a combo box shows up as the field # instead of the text.
How can I correct this?

Gammatekk

gammatekk is offline   Reply With Quote
Old 10-18-2019, 08:10 AM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,593
Thanks: 58
Thanked 1,444 Times in 1,425 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: exporting to word

What exactly are you exporting? A form?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-18-2019, 08:18 AM   #3
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

fields from a form, that go into a word document for printing out.

gammatekk is offline   Reply With Quote
Old 10-18-2019, 08:19 AM   #4
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,593
Thanks: 58
Thanked 1,444 Times in 1,425 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: exporting to word

Quote:
Originally Posted by gammatekk View Post
fields from a form, that go into a word document for printing out.
Not sure I'm clear yet. Can you show us the code you're using for the export? If you're doing it manually using the Ribbon, could you describe the steps you take? Thanks!
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-18-2019, 09:47 AM   #5
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,892
Thanks: 38
Thanked 572 Times in 539 Posts
MajP has a spectacular aura about MajP has a spectacular aura about
Re: exporting to word

I have not tested that, but I think that is the normal behavior. If you have a combobox and the bound field is the primarykey (numeric), but the combo is showing the related text then when you export you get the bound value. The easy solution is to turn it into a textbox and include the text in the query.
MajP is offline   Reply With Quote
Old 10-18-2019, 10:13 AM   #6
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

sorry, so new to this, let me me see if this works.

But I think MajP might be on to something
Attached Files
File Type: pdf code for export.pdf (22.6 KB, 6 views)
gammatekk is offline   Reply With Quote
Old 10-18-2019, 10:14 AM   #7
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

my word document has bookmarks that correspond to the fields

gammatekk is offline   Reply With Quote
Old 10-18-2019, 10:15 AM   #8
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

Also, I have to have word already open for this to work. Word does not open, as i thought the code would do.
gammatekk is offline   Reply With Quote
Old 10-18-2019, 10:40 AM   #9
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,593
Thanks: 58
Thanked 1,444 Times in 1,425 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: exporting to word

Quote:
Originally Posted by gammatekk View Post
sorry, so new to this, let me me see if this works.

But I think MajP might be on to something
Hi. Thanks for posting the code. For the combobox controls, you can use the Column property to grab the displayed value instead of the bound value. For example:
Code:
.FormFields("DropDown1").Result = Me.PET_TX.Column(1)
Hope that helps...
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-18-2019, 10:48 AM   #10
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

ok, let me give it a try
gammatekk is offline   Reply With Quote
Old 10-18-2019, 10:50 AM   #11
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,593
Thanks: 58
Thanked 1,444 Times in 1,425 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: exporting to word

Quote:
Originally Posted by gammatekk View Post
ok, let me give it a try
Hi. Since I was just guessing which one is a combobox, please make sure you pick the right one and use its name, okay? Also, just FYI, Column index is zero (0) based. So, if you want the 3rd column, use 2. Cheers!
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-18-2019, 01:15 PM   #12
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

unfortunately my word fields are now empty after adding ".Column(x)"
checked correct column and correct spelling etc.
gammatekk is offline   Reply With Quote
Old 10-18-2019, 01:42 PM   #13
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,593
Thanks: 58
Thanked 1,444 Times in 1,425 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: exporting to word

Quote:
Originally Posted by gammatekk View Post
unfortunately my word fields are now empty after adding ".Column(x)"
checked correct column and correct spelling etc.
Can you show us an example of how you implemented it? Thanks!
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
gammatekk (11-01-2019)
Old 10-18-2019, 02:20 PM   #14
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

Ok, so i changed them all to column(1) and it works??
gammatekk is offline   Reply With Quote
Old 10-18-2019, 03:15 PM   #15
gammatekk
Newly Registered User
 
Join Date: Oct 2019
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
gammatekk is on a distinguished road
Re: exporting to word

Here is the code that works
Attached Files
File Type: pdf code for export2.pdf (21.9 KB, 3 views)

gammatekk is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question Exporting to a word doc buffer General 2 01-17-2011 01:57 AM
exporting to word madrav72 Reports 1 01-24-2006 09:31 AM
Exporting into word Nick Druce Forms 0 03-21-2005 07:24 AM
Exporting to Word bob makepeace Reports 2 05-22-2001 09:57 AM
Exporting to Word itchy Reports 3 02-09-2001 12:28 PM




All times are GMT -8. The time now is 09:51 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World