Editing Control Contents

  • Thread starter Thread starter John Smith
  • Start date Start date
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
 
Tim

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

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

Kind regards

Tim
 
Back
Top