Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

A Q on textboxes

Posted on 1999-07-25
10
Medium Priority
?
212 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:CATT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 6

Expert Comment

by:VBGuru
ID: 1527285
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.
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1527286
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

0
 

Author Comment

by:CATT
ID: 1527287
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:VBGuru
ID: 1527288
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
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 1527289
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
0
 

Author Comment

by:CATT
ID: 1527290
well I thought of height excatly cause I use multiline, yes.
?
0
 

Author Comment

by:CATT
ID: 1527291
Have to reject you, I need an answer.
0
 

Author Comment

by:CATT
ID: 1527292
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

0
 

Author Comment

by:CATT
ID: 1527293
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.
:\
0
 
LVL 1

Accepted Solution

by:
DefTones earned 150 total points
ID: 1527294
set the tabindex of the box u want to carry onto 1 higher than the one youve just left from

then do this

Private Sub Text1_Change()
if len(Text1.text) > 10 then sendkeys "{TAB}"
End Sub

OR:

Private Sub Text1_Change()
if len(Text1.text) > 10 then text2.setfocus
End Sub

Simple
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question