A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referencing a User Form using an If statement field code



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2009, 09:31 PM posted to microsoft.public.word.mailmerge.fields
Brenda A. Reid[_2_]
external usenet poster
 
Posts: 1
Default Referencing a User Form using an If statement field code

Word 2007
I am using a vba user form to fill in vendor and purchaser names. There
could be one vendor or two vendors. All through the template there are
spots where you have to refer to either Vendor or Vendors. Rather than
using vba coding and bookmarks, I'd like to use something like the following
in the template but it is not working. Is there a way to reference a user
form field?

My example: Vendor{if PrecForm1.Vendor2.text "" "s" ""}

So what I'm trying to say is if the vendor2 field is filled in on the form,
then use Vendors instead of Vendor.

Brenda


  #2  
Old August 12th, 2009, 11:45 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Referencing a User Form using an If statement field code

The way I would do this would be to have the term Vendor or Vendors appear
as a result of the value assigned to a document variable and use a {
DOCVARIABLE } in the document where ever the term is to appear.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Brenda A. Reid" wrote in message
...
Word 2007
I am using a vba user form to fill in vendor and purchaser names. There
could be one vendor or two vendors. All through the template there are
spots where you have to refer to either Vendor or Vendors. Rather than
using vba coding and bookmarks, I'd like to use something like the
following in the template but it is not working. Is there a way to
reference a user form field?

My example: Vendor{if PrecForm1.Vendor2.text "" "s" ""}

So what I'm trying to say is if the vendor2 field is filled in on the
form, then use Vendors instead of Vendor.

Brenda


  #3  
Old August 13th, 2009, 04:13 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Referencing a User Form using an If statement field code

Please do not post the same question separately to multiple newsgroups.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Brenda A. Reid" wrote in message
...
Word 2007
I am using a vba user form to fill in vendor and purchaser names. There
could be one vendor or two vendors. All through the template there are
spots where you have to refer to either Vendor or Vendors. Rather than
using vba coding and bookmarks, I'd like to use something like the
following in the template but it is not working. Is there a way to
reference a user form field?

My example: Vendor{if PrecForm1.Vendor2.text "" "s" ""}

So what I'm trying to say is if the vendor2 field is filled in on the
form, then use Vendors instead of Vendor.

Brenda


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.