K
Khoa
Hi all,
How can I select entire a field after it has been updated ?
Here are some code in my form:
'---------------
Private Sub AccID_GotFocus()
Me.TempID = Me.AccID
End Sub
'------------------
Private Sub AccID_AfterUpdate()
If DLookup("[AccID]", "AccTbl", "[AccID] = '" & Me.AccID & "'") > 0 Then
If Me.AccID <> Me.TempID Then
MsgBox "AccID Exist !"
Me.AccID = Me.TempID
TempID.SetFocus
With Me!AccID
.SetFocus
.SelStart = 0
.SelLength = Len([AccID])
End With
End If
End If
End Sub
'---------------
But then when I enter a AccID that already has, the cursor always stay at
the end of AccID text box. I just want to select the entire field then users
have more convenient to re-change it. Any suggest would be appreciated.
How can I select entire a field after it has been updated ?
Here are some code in my form:
'---------------
Private Sub AccID_GotFocus()
Me.TempID = Me.AccID
End Sub
'------------------
Private Sub AccID_AfterUpdate()
If DLookup("[AccID]", "AccTbl", "[AccID] = '" & Me.AccID & "'") > 0 Then
If Me.AccID <> Me.TempID Then
MsgBox "AccID Exist !"
Me.AccID = Me.TempID
TempID.SetFocus
With Me!AccID
.SetFocus
.SelStart = 0
.SelLength = Len([AccID])
End With
End If
End If
End Sub
'---------------
But then when I enter a AccID that already has, the cursor always stay at
the end of AccID text box. I just want to select the entire field then users
have more convenient to re-change it. Any suggest would be appreciated.