exporting to word

gammatekk

Registered User.
Local time
Yesterday, 18:54
Joined
Oct 16, 2019
Messages
10
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
 
What exactly are you exporting? A form?
 
fields from a form, that go into a word document for printing out.
 
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!
 
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.
 
sorry, so new to this, let me me see if this works.

But I think MajP might be on to something
 

Attachments

my word document has bookmarks that correspond to the fields
 
Also, I have to have word already open for this to work. Word does not open, as i thought the code would do.
 
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...
 
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!
 
unfortunately my word fields are now empty after adding ".Column(x)"
checked correct column and correct spelling etc.
 
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!
 

Users who are viewing this thread

Back
Top Bottom