K
Karen Hart
Re Access XP - method for locating desired record:
I have an unbound field in a continuous form where the user types the first
few letters of the last name and presses enter.
Then the following code brings the user to that record:
Private Sub Lookup_AfterUpdate()
On Error GoTo Quit
With CodeContextObject
DoCmd.GoToControl "LAST"
DoCmd.FindRecord .Lookup, acStart, False, , False, , True
End With
Quit:
End Sub
This code works fine. The control source of LAST is the LastName field of
the underlying table.
The problem comes when I change the control source of LAST to
=[LastName] & ", " & [FirstName]
My FindRecord command can't seem to find the record once I change the
control source to this.
Many thanks in advance.
Cheers,
Karen
I have an unbound field in a continuous form where the user types the first
few letters of the last name and presses enter.
Then the following code brings the user to that record:
Private Sub Lookup_AfterUpdate()
On Error GoTo Quit
With CodeContextObject
DoCmd.GoToControl "LAST"
DoCmd.FindRecord .Lookup, acStart, False, , False, , True
End With
Quit:
End Sub
This code works fine. The control source of LAST is the LastName field of
the underlying table.
The problem comes when I change the control source of LAST to
=[LastName] & ", " & [FirstName]
My FindRecord command can't seem to find the record once I change the
control source to this.
Many thanks in advance.
Cheers,
Karen