Covert Word to Text to Access

PlasticRecruiter
07-04-2001, 11:52 AM
Can anyone help. Need a macro to eliminate carraige returns of records in a membership directory

lwoods
07-04-2001, 08:39 PM
Dim s As String
Dim ss As String
' Access 2000
ss = Replace(s, Chr$(10), "")


' Access 97
Dim i As Integer
Dim ss As String
For i = 1 To Len(s)
If Mid$(s, i, 1) <> Chr$(10) Then
ss = ss & Mid$(s, i, 1)
End If
Next i

This was done VERY quickly, so I didn't go by any standards, etc. String s is the input, and ss is the output. Replace is not available in AC97. If you are looking for LINE FEED characters, then the character is Chr$(10). If CARRIAGE RETURNS, then Chr$(13). You might be looking for both. If you are lucky and are using AC 2000, then the Replace above can look for both characters at the same time:

ss=Replace(s,vbcrlf,"")

or

ss=Replace(s,chr$(13) & chr$(10),"")

Larry Woods

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum