filter records in a form

  • Thread starter cmweb via AccessMonster.com
  • Start date
C

cmweb via AccessMonster.com

I've created a form with its subform to enter tasks of employees. however I
need filter records only for active employees
The form has as a source, the table CARD_EMP (employee card). It has a field
ST_EMP for the employee status (Active , Pasive)

In the Event Form_Current I wrote
DoCmd.ApplyFilter ST_EMP='A'

but it doesn't work

Thanks for advance
Carlos
 
G

Guest

Carlos,

Have you tried something like:

Private Sub Form_Load()
Me.Filter = "[ST_EMP]=""A"""
Me.FilterOn = True
Me.Recalc
End Sub

I'm using Access 2007, so I'm not sure if this syntax works for you.

mamumi
 
G

Guest

I have a similar quest.
Here is what I have tried and it does not seem to work. The bottom of the
form says "filtered" but I get every record instead of the "active" ones. In
the below code, I have tried "true" and "yes" for the checkbox and get the
same results.

Private Sub Form_Load()

Me.Filter = [chkActive] = True
Me.FilterOn = True
Me.Recalc

End Sub


mamumi said:
Carlos,

Have you tried something like:

Private Sub Form_Load()
Me.Filter = "[ST_EMP]=""A"""
Me.FilterOn = True
Me.Recalc
End Sub

I'm using Access 2007, so I'm not sure if this syntax works for you.

mamumi

cmweb via AccessMonster.com said:
I've created a form with its subform to enter tasks of employees. however I
need filter records only for active employees
The form has as a source, the table CARD_EMP (employee card). It has a field
ST_EMP for the employee status (Active , Pasive)

In the Event Form_Current I wrote
DoCmd.ApplyFilter ST_EMP='A'

but it doesn't work

Thanks for advance
Carlos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top