Form filter coding issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I built a time card fomr in my app and I'm trying to filter the field
[logingid] so that the current user can see only his/her time cards.
However, for some reason, the cose I oput in form's OPEN even is not
returning any records:

Private Sub Form_Open(Cancel As Integer)

Me.Filter = Me.LoginID = CurrentUser()
Me.FilterOn = True
End Sub

Any ideas?
 
Hi B -- Is LoginID a string or number? If it's the latter, your code won't
work b/c CurrentUser() will return a string. If it's the former, you need to
use quotes when trying to apply the filter b/c the string expression is a
WHERE clause without the WHERE keyword. Try:

Me.Filter = "Me.LoginID = CurrentUser()"
Me.FilterOn = True
 
Back
Top