Scrolling Text Box

mavver

Registered User.
Local time
Today, 02:12
Joined
Jan 12, 2007
Messages
28
Hello All, hopefully someone can help me with this

I am building a response database, where someone in the orginisation can ask a question in a text box (memo) and another will answer it in another text box on the same form.

However, there is a slight issue that if the user needs to scroll within the text box and then gets focus in another text box, the first text box goes to the top.

So after all that rambling, the question is

Is it possible after you lose focus in a text box, not to have the text scroll back to the top

I hope you understand this, I kinda confused myself

Thanks in advance

Mav
 
Mav,

You can use the textbox's LostFocus event to save the value:

Me.YourTextBox.SelStart

Then you can use the textbox's GotFocus event to:

Me.YourTextBox.SelStart = Me.TheSavedValue

You can save the value in an invisible textbox, or whatever.

You'll probably want to also use the textbox's OnClick event to override
where Access wants to put the cursor.

Play around with it, it might do what you want.

hth,
Wayne
 
It's a little bit complicated, but I've seen it done before. The basic game plan is this.

You make a form, call it QuestionForm.
Set the Record Source to your table/query.
Size the form just large enough to hold your memofield and a tiny bit larger.
Place 2 items on this form. The field that holds uniquely identifying data (such as an ID number) and the memobox that holds the Question.
Go into the Properties box and set these properties:

Scroll bars None
Record Selector No
Navigation Buttons No
Dividing Lines No
Border Style None
Control Box No
Min Max Buttons None
Close Button No

From the Objects dialog box select this form and copy it; name the copy AnswerForm.
Go into Design View and click on the memobox that currently holds the Question memofield. Go into the properties box, go to the Data tab and use the down arrow to change the ControlSource from the Question memofield to the Answer memofield. Save the form.

Make a third form.
Set its Record Source to the same table/query as the other two forms.
Place on this form the field that holds the uniquely identifying data.

Place a subform on this form. When the wizard comes up, select as the source the Question form.
Select the subform and goto Properties - Data.
Click on Link Master Fields
Set both Master Field and Child Field to the same uniquely identifying field.

Add a second subform and make its source the Answer form.
Repeat the above steps.

By now you get the general idea. When you leave the Question memobox (on the first subform) it will stay in whatever scrolled position it was in. You go to the Answer memeobox and do whatever. When you come back to the Question memobox it will be in the same positon as when you left; it won't scroll up to the top of the memobox.

Good Luck!

Linq
 

Users who are viewing this thread

Back
Top Bottom