Need to enter a tab in word if user entered one while entering the data into Access 
Author Message
 Need to enter a tab in word if user entered one while entering the data into Access

I have a program that transfers data from Access97 into word97.  The
user is entering something like this:
1. Information:
     a.sub info
     b)sub info

However, once transported to word, the information displays like so:
1. Information a.sub info b)sub info

How do I figure out what char is coming before the a.,b),etc... and
then how do I replace that char with a tab?

I'm rather new at VBA and have been thrown into the water with this
one.  Any help would be greatly appreciated.

Sunshine

P.S. Are there any other good websites with info on VBA functions that
I could reference?



Mon, 31 May 2004 23:11:56 GMT  
 Need to enter a tab in word if user entered one while entering the data into Access
It's quite rare for Access 97 text or memo fields to contain tabs,
because the standard textbox used for displaying them doesn't accept
or interpret tab characters (it just displays them as square boxes).

To find out what character is actually coming across into Word where
you want there to be a tab (actually, it looks from your sample as if
you need a paragraph mark and a tab:

1) select (highlight) one of these characters
2) go to the Immediate pane of the VB editor and type
        ? Asc(Selection). The code for a tab character is 9.



Quote:
>I have a program that transfers data from Access97 into word97.  The
>user is entering something like this:
>1. Information:
>     a.sub info
>     b)sub info

>However, once transported to word, the information displays like so:
>1. Information a.sub info b)sub info

>How do I figure out what char is coming before the a.,b),etc... and
>then how do I replace that char with a tab?

>I'm rather new at VBA and have been thrown into the water with this
>one.  Any help would be greatly appreciated.

>Sunshine

>P.S. Are there any other good websites with info on VBA functions that
>I could reference?

John Nurick [Access MVP]

Please do not respond by email, but to the newgroup.



Mon, 07 Jun 2004 18:15:53 GMT  
 Need to enter a tab in word if user entered one while entering the data into Access
Hi Sunshine

~~~~~~
How do I figure out what char is coming before the
a.,b),etc
~~~~~~
Select the character and run the line Msgbox Asc
(Selection.Text)

~~~~~~
then how do I replace that char with a tab?
~~~~~~
Do a find and replace, replacing ^(character number) with
^t.

~~~~~~
Are there any other good websites with info on VBA
functions that I could reference?
~~~~~~
http://www.mvps.org/word/

Especially under FAQs, on the Macros/VBA tab. Also under
Tutorials. And if in doubt, try the Search page.

Regards

Dave

Quote:
>-----Original Message-----


12/13/2001 7:11:56 AM

I have a program that transfers data from Access97 into
word97.  The
user is entering something like this:
1. Information:
     a.sub info
     b)sub info

However, once transported to word, the information
displays like so:
1. Information a.sub info b)sub info

How do I figure out what char is coming before the
a.,b),etc... and
then how do I replace that char with a tab?

I'm rather new at VBA and have been thrown into the water
with this
one.  Any help would be greatly appreciated.

Sunshine

P.S. Are there any other good websites with info on VBA
functions that I could reference?



Mon, 07 Jun 2004 22:02:15 GMT  
 Need to enter a tab in word if user entered one while entering the data into Access
Thanks so much John!

What I did:
   I used the immediate window like you said, and found a Chr(13)
followed by a Chr(10) coming in where a tab was entered in Access.  I
changed the Chr(13) position in the string to = vbCrLf and the Chr(10)
position to = vbTab and it works perfectly!  Thanks again for you
help!!!

Sunshine



Mon, 07 Jun 2004 22:41:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. enter ctrl+enter key into a text box

2. ENTER and keypad ENTER

3. Distinguish between keyboard enter and keypad enter w/KeyUp

4. Distinguish between keyboard enter and keypad enter w/KeyUp

5. Distinguish between keyboard enter and keypad enter w/KeyUp

6. Comparing user entered data to listbox data??

7. Help! Tab key erases entered data

8. Help: Scrolling data controls using Enter key instead of Tab

9. Help: Scrolling data controls using Enter key instead of Tab

10. enter data in user form item

11. Retain user entered data in template (WD97, NT4)

12. Scrolling flexgrid as user enters data...

 

 
Powered by phpBB® Forum Software