It seems like it should be straight forward to me, but I'm missing something, because I keep getting an error when I run the code that says, "The MS Database Engine does not recognize Smith (or any other last name I enter) as a valid field name or expression".
I just have a simple form that I want users to sort by last name. I created a command button in a header with the following placed in the on click code.
Can anybody tell me what I am doing wrong???
Private Sub Command99_Click()
2 If IsNull(Name_Search) = False Then
3 Me.Recordset.FindFirst "[Client_Last_Name]=" & Name_Search
4 Me!Name_Search = Null
5 If Me.Recordset.NoMatch Then
6 MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
7 Me!Name_Search = Null
8 End If
9 End If
10 End Sub
Jumat, 22 Juni 2012
[MS_AccessPros] Search by last name on a form V2010
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar