Double Spacing Text Entry - Forms or Reports?

Mist

Registered User.
Local time
Today, 16:29
Joined
Mar 5, 2012
Messages
66
Hi - I'm trying to double space the text characters on a form or, ultimately a report. I need to print database fields on a pre-printed form which has a 'block' entry format for each character. I then plan to play around with the font size/type to align the printing with these 'blocks'/'squares'...

How do I set up a form to accept double-spaced entry or, alternatively, set up the report to do this for me? If anyone has a different method of tackling this I will be very pleased with your advice. Many thanks :)
 
If you want to double space when the user is inputting the text, a Ctrl+Enter will create a new line, if only want to do formatting of output, you might try using vbcrlf in code.
 
Thanks for the input but I'm talking about inserting space(s) between characters not lines ...
 
To put it another way: I wish to have some code or something else that will read the user’s input and insert spaces between the characters. This can be in the table itself but ideally it would take place during the formatting/printing of particular reports.
 
y e a h ..e x c e p t m y a p p l i c a t i o n n e e d s i t!
 
Code:
Function ParseString(AnyString As String) As String
Dim tmpStr As String
Dim lngCount As Long
 
If Len(AnyString) = 0 Then
    ParseString = vbNullString
    Exit Function
End If
 
For lngCount = 1 To Len(AnyString)
    tmpStr = tmpStr & Mid(AnyString, lngCount, 1) & " "
Next
 
ParseString = Left(tmpStr, Len(tmpStr) - 1)
End Function

JR
 
Last edited:
Thanks JR - will give it a try. Much appreciated!
 
um... 42! - wasn't sure where to post where I would get a meaningful response, maybe my request wasn't clear.. point taken!
 
Thanks JR - will give it a try. Much appreciated!

No problem. I have updated the function to include some errorhandling in case of "empty strings"

JR
 
Thanks again - I tried it and as expected it does the job. I tested it in a table update query but not sure how to declare and use it in forms and/or reports. I know how to create a module function but not sure how to call it from a form or report?

The 'errr handling' mod to handle 'empty strings' will be useful - thanx
 
Last edited:
I tested it in a table update query

I woulden't go this way and update the table, keep the tablefield as it was and just call the function on demand in a query or create a calculated field in a reports recordsource.

MySpacedField: Iif(Len([TableField] & "") >0, ParseString([TableField]),"")

The function needs to be in a Standard module

JR
 
Thanx JR - looks like a neat piece of code and yes, I want to keep the table clean and untouched in the final application. I will be trying the code out shortly.
 

Users who are viewing this thread

Back
Top Bottom