Reputation: 495
I'm trying to setup a simple filter button that will filter by the network user ID which is populated in the [Owner] field when a record is created. The idea is to see only the records you created.
the code I'm using is as follows:
Private Sub FilterUser_Click()
Dim Uname As String
Uname = Environ("USERNAME")
Me.Tasks.Form.Filter = [Owner] = Uname '<---- Error debugs this line
Me.Tasks.Form.FilterOn = True
End Sub
I get the following error but I'm confused on what field it thinks is missing.
Any help would be greatly appreciated.
Upvotes: 0
Views: 146
Reputation: 4640
Filter requires a string value.
me.tasks.form.filter = "[owner]='" & uname & "'"
Upvotes: 1