Editing Control Contents

J

John Smith

Hi,

I have a simple form where a combo box (cmbProductCode) invites the user to
select a record from the products table.

The after update event is then coded to fill in a text box (
textDescription) - which then receives the focus.

The description is only a partial description for the user to complete -
let's say "Bunch of Flowers -" for the user to add the word "Roses".

The problem is that on receiving the focus the contents of textDescription
are selected such that any typing to add "Roses" for example will replace
"Bunch of Flowers -" leaving the user with just "Roses". It can be got round
by moving right and then left again but this is clumsy.

Help Please! This is driving me NUTS.

Tim
 
G

Guest

Tim

You can set the cursor at the end using this code:
Me.txtProdName.SetFocus
Me.txtProdName.SelStart = Len(Me.txtProdName)
 
J

John Smith

Bill,

Sorry for the delay in replying - thank you for an effective and elegant
solution.

Kind regards

Tim
 

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