Textbox Control

  • Thread starter Proposal Doctor
  • Start date
P

Proposal Doctor

I use two large textboxes on a form to create project descriptions. Is there
a way to prevent the insertion point in the source box from moving to the top
when I enter information in the opposite text box?

Thx.

David
 
J

Jeff Boyce

We aren't there. We can't see what you're looking at.

What do you mean "the opposite text box"?

What do you mean "prevent ... from moving to the top"?

Regards

Jeff Boyce
Microsoft Access MVP
 
P

Proposal Doctor

Thanks Jeff.

I have two textboxes side-by-side on the form, each is about 6 inches by 8
inches.

One textbox is the source box for the project descriptions and one is the
destination textbox. When I put the insertion point in the source box, the
target box forgets where the insertion point was the last time it had focus.

I want the target box to remember the exact point where the insertion point
was last and return to that position when it receives the focus again.

Can this be done?

David

P.S.
The textboxes are not on a subform. All the objects on the form use the
same table.
 
L

Linq Adams via AccessMonster.com

Your names not Chip is it? I ask because I just answered an almost identical
question for him yesterday, on another station, as they say!

Funny you should say "The textboxes are not on a subform," because I did
something like this a few years ago for somebody and the only way I could get
it to work was to

1. Create a second form with the same Record Source
2. Add the one textbox field
3. Strip this form of everything you can, Nav buttons, Control box,
Dividing
line, etc. so you only have the single field showing
4. Go back and add this second form as a subform to the original form

Now you can scroll thru the subform field, and when you click out of it to
another control on the main form, the cursor will remain in the same place.

This was done for someone who only needed to scroll thru the memo field to
reference its contents. You can copy data in the subform field, which sounds
like what you're trying to do, and the cursor will remain unchanged when you
click elsewhere.
 
M

Marshall Barton

Proposal said:
I use two large textboxes on a form to create project descriptions. Is there
a way to prevent the insertion point in the source box from moving to the top
when I enter information in the opposite text box?


Try experimenting with code something like:

Module level declaration:
Private lngStart As Long

Enter event procedure:
Me.sourcetextbox.SelStart = lngStart
Me.sourcetextbox.SelLength = 0

Exit event procedure:
lngStart = Me.sourcetextbox.SelStart
 
P

Proposal Doctor

Sorry, I am not Chip.

Your solution is one that I had not thought of but is definitely one that I
can implement and will probably use a lot, as most of my apps include
numerous memo fields. I am always looking for ways to make better use of
memo fields.

Thank you.

David
 
P

Proposal Doctor

Thanks Marsh,

This code is above my skill level so please provide me with the number of a
KB article or text that will help me understand what the code does.

David
 
M

Marshall Barton

I don't know of any articles that discuss this kind of
thing. Look up any part of it that you do not understand in
VBA Help (in the Visual Basic editor window). If you have a
problem interpreting what the help topics say, come on back
with a specific question.

I added a few comments to the code that may provide a few
more clues.
--
Marsh
MVP [MS Access]


Proposal said:
This code is above my skill level so please provide me with the number of a
KB article or text that will help me understand what the code does.
'set cursor position back to where it was
'when last left the text box
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top