Trailing characters in form fields

J

Jerome Nocerino

I am using Access to prefill Word forms using form field bookmarks. That all works fine except that there are trailing blank spaces at the end of every field. I wouldn't mind except that in some case they cause a return that alters the alignment of the data.

Is there any way to trim these trailing spaces with my Access VBA code while the form is being populated?

Thanks.


Submitted via EggHeadCafe - Software Developer Portal of Choice
AJAX enabled web page design and beginner?s concept
http://www.eggheadcafe.com/tutorial...6-c132b45b71e4/ajax-enabled-web-page-des.aspx
 
J

Jeff Boyce

Jerome

If you are using a query to "feed" your Word forms, you can use the Trim()
function to remove leading and trailing spaces.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jerome Nocerino

Trim doesn't work. Apparently my bookmark data is being inserted before the placeholder spaces thae Word uses for blank form fields. The code I'm using from Access is:

.Selection.Text = Trim(me.txtJobNumber)

Thanks for your input



Jeff Boyce wrote:

JeromeIf you are using a query to "feed" your Word forms, you can use the
14-Jan-10

Jerome

If you are using a query to "feed" your Word forms, you can use the Trim()
function to remove leading and trailing spaces.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
How to make your Web Site More Googly
http://www.eggheadcafe.com/tutorial...b-e3ffb0363ac0/how-to-make-your-web-site.aspx
 
J

Jeff Boyce

"doesn't work" covers a lot of possibilities...

Since your textbox control was created by you, have you first tried using

Me!txtJobNumber

rather than the "dot" version (".")?

The folks here might be able to come up with some other ideas if you'd post
a bit more context for the code you're using...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top