Why am I not able to place focus on a form field and and the carret at the end of the content?
When the form opens the control doesn't have focus and if the textbox has content the carret is not at the end ?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music Downloads
Code:
Dim zoomCtl As Access.TextBox
Dim ctl As Object
Set zoomCtl = Me.inputTextBox
Set ctl = BoundControl.Parent
Do While Not TypeOf ctl Is Access.Form
Set ctl = ctl.Parent
Loop
Set oControl = BoundControl
Set Me.Recordset = ctl.Recordset
With zoomCtl
.ControlSource = BoundControl.ControlSource
.Locked = BoundControl.Locked
.ValidationRule = BoundControl.ValidationRule
.ValidationText = BoundControl.ValidationText
.Format = BoundControl.Format
.ControlTipText = BoundControl.ControlTipText
.ForeColor = BoundControl.ForeColor
.TextAlign = 1
End With
' THIS CODE BELOW DOESN'T SEEM TO WORK ?
Me.inputTextBox.SetFocus
If Not IsNull(Me.inputTextBox) Then
Me.inputTextBox.SelStart = Len(Me.inputTextBox)
Else
Me.inputTextBox.SelStart = 1
End If
When the form opens the control doesn't have focus and if the textbox has content the carret is not at the end ?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music Downloads