Tark221
Registered User.
- Local time
- Today, 23:12
- Joined
- Oct 12, 2012
- Messages
- 74
Good Evening all,
I have a problem I'm hoping someone can help me with.
I will try and keep this brief. I have a paragraph of text, I have to paste it into a system which allows me 75 characters in a line and 208 in a page.
I have code which creates text boxes dynamically based on the total amount of characters/208 - this gives me how many textboxes need creating. I also have code which then populates those textboxes 208 characters at a time. I now need to alter it so it puts a line break every 75 characters. I hope this makes sense.
That was the code to dynamically create the textboxes on the form "NoteForm then opens it.
Once opened, on the load event it populates the textboxes with this code
So i've achieved almost what I want, I just need to amend it so it starts a new line after every 75 characters
any help would be much appreciated
thanks
I have a problem I'm hoping someone can help me with.
I will try and keep this brief. I have a paragraph of text, I have to paste it into a system which allows me 75 characters in a line and 208 in a page.
I have code which creates text boxes dynamically based on the total amount of characters/208 - this gives me how many textboxes need creating. I also have code which then populates those textboxes 208 characters at a time. I now need to alter it so it puts a line break every 75 characters. I hope this makes sense.
Code:
Private Sub btnsubmit_Click()
DoCmd.OpenForm "NoteForm", acDesign
Dim x As Integer
Dim ctrl As Control
Dim y As Integer
txtcnt = Len([Forms]![Main].[Main_tbNote])
tbcnt = txtcnt / 208
For x = 1 To tbcnt
'CREATING TEXTBOX'S
Set ctrl = CreateControl("NoteForm", acTextBox, acDetail, , "", 700, 900 + (x * 1000), 6000, 800)
Set ctrl2 = CreateControl("NoteForm", acCommandButton, acDetail, , "", 20, 20 + (x * 250), 600, 240)
'CONTROL NAMES
ctrl.ControlName = "TextBox" & x
ctrl2.ControlName = "CopyButton" & x
Next x
DoCmd.OpenForm "NoteForm"
End Sub
That was the code to dynamically create the textboxes on the form "NoteForm then opens it.
Once opened, on the load event it populates the textboxes with this code
Code:
Private Sub Form_Load()
Dim intCount As Integer
Dim iBox As Integer
intCount = Len([Forms]![Main].[Main_tbNote])
endCount = intCount / 208
iBox = 1
For iBox = 1 To endCount
Me.Controls("TextBox" & iBox) = Left([Forms]![Main].[Main_tbNote], 208)
[Forms]![Main].[Main_tbNote] = Mid([Forms]![Main].[Main_tbNote], 209)
intCount = intCount - 208
Next iBox
End Sub
So i've achieved almost what I want, I just need to amend it so it starts a new line after every 75 characters
any help would be much appreciated
thanks