I'm writing an accounting application and on the data entry Form I use a
macro to automatically fill in fields for regular recurring entries, e.g. a
payment of a Gas or Electricity bill. This speed up the data entry a lot,
as usually the only fields that need changing are the Date and Amount
fields. Then I use the following code to position the cursor in the Amount
field :-
*Sub SetCursor(ThisComponent as Object, ControlName as String)
Dim oControl AS Object
Dim oController AS Object
Dim oControlView AS Object
oControl = oFormTransHeader.getByName(ControlName)
oController = oControl.Parent.Parent.Parent.CurrentController
oControlView = oController.GetControl(oControl)
oControlView.SetFocus()
End Sub
*This works well, but what I haven't been able to work out is how to
highlight the Amount field so that the user can then type in the new amount
over the top of the existing amount. The user could just type Ctrl + A,
but I'm trying to reduce key strokes to as few as possible.
I've looked for code that would send Ctrl + A to the form, but drew a blank
on that.
I've also xRayed *oControlView*, but there doesn't seem to be any method
there that does highlighting either.
Can anyone point me to a solution?
Thanks,
Noel