Link to home
Start Free TrialLog in
Avatar of CATT
CATT

asked on

A Q on textboxes

I have a prob.

I have a database with a field called 'tekst' (memo-type, access7), that I read in to a textbox. My problem is to know when the textbox is full, and how to continue in the second textbox. (there is only these two). Then by the click at a button they shall both load in the next two sections. It has to be after how much space there is, NO preset maxlength! It will also be depending on fonttype and size, that is chosen by user.

Do you have a clue?
Avatar of VBGuru
VBGuru
Flag of India image

This piece of code will tell you when the first text box is filled. then you can goto second text box. To start click on the form. everytime go on adding a letter.
Option Explicit
Dim str As String
Private Sub Form_Click()
str = str & InputBox("New value")
If TextWidth(str) >= Text1.Width Then
    MsgBox "Text box is full"
End If
Text1 = str
End Sub

Avatar of CATT
CATT

ASKER

Well ok, I come up with this;

Dim str, tekst
tekst = rec("tekst")
Do While TextHeight(str) <= hojre.Height
str = str & tekst
If TextHeight(str) >= venstre.Height Then
hojre.Text = str
If TextHeight(str) >= hojre.Height Then
MsgBox "Text box is full"
End If
End If
venstre.Text = str
Loop

...but it gives me the same tekst in both boxes, what am I to do?
why are you testing for the height. It depends on the fontheight. In that case you got to change the height of the text box.
by the way are you using multiline text box
why are you testing for the height. It depends on the fontheight. In that case you got to change the height of the text box.
by the way are you using multiline text box
Avatar of CATT

ASKER

well I thought of height excatly cause I use multiline, yes.
?
Avatar of CATT

ASKER

Have to reject you, I need an answer.
Avatar of CATT

ASKER

Dim str, tekst, streng
tekst = rec("tekst")
Do While TextHeight(str) <= hojre.Height
str = str & tekst
If TextHeight(str) >= venstre.Height Then

'what am i to do for reading from last character an on.

If TextHeight(str) >= hojre.Height Then

'what am i to do for marking where I am in the text, for continuing with the two textboxes again, at another click (like read in page (textbox) 3 and 4

End If
End If
venstre.Text = str
Loop

Avatar of CATT

ASKER

Ok, I need to know how I start from a sertain place.
I have in the above included;

lang = Len(str)

getting the length of the string in textbox1. Now I need to continue. But how?
.Yes I am plain dumb, and yes I am a newbie still.
:\
ASKER CERTIFIED SOLUTION
Avatar of DefTones
DefTones

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial