ApplyFilter problem

M

magmike

I have a combo box (CallDateLookup) that is populated by a query that
pulls up only dates that have calls scheduled on them.

When the user selects the combo box, they see of list of those dates.
Currently, the AfterUpdate code only sends the user to the first
record in the set with that date. However, I am trying to change that
to filter the form for only records with that date.

I must have done it wrong, because when the date is selected, it still
ask for the value. Please tell me what I have done wrong!

Code:
DoCmd.ApplyFilter , "CallDate = CallDateLookup"

Thanks in advance!
magmike
 
J

Jay

Hi,

I'm prettty new to Access, and I've only used Access 2007, so I can't
guarantee this will work, but here goes.

Try CallDate = CallDateLookup.Text or CallDate = CallDateLookup!Text.
 
J

Jay

Oops, I don't think my those suggestions are correct.

Try using Access' filtering controls (in the ribbon or by right-click) to
perform a similar filter, then switch to design view and see what Access put
in the Form's Filter property. Don't forget to remove clear the filter
property in design view once you've looked at it.

The help file says the parameter is like an SQL where clause, so it looks
like you need something like

"[FileName].[CallDate] = #" & CallDateLookup & "#"

if the form's data source is a table or

"[QueryName].[CallDate] = #" & CallDateLookup & "#"

if the form's data source is a query.
 
M

magmike

Hi,

I'm prettty new to Access, and I've only used Access 2007, so I can't
guarantee this will work, but here goes.

Try CallDate = CallDateLookup.Text or CallDate = CallDateLookup!Text.









- Show quoted text -

Thanks, but neither of those worked. Thanks though.
 
M

magmike

Oops, I don't think my those suggestions are correct.

Try using Access' filtering controls (in the ribbon or by right-click) to
perform a similar filter, then switch to design view and see what Access put
in the Form's Filter property.  Don't forget to remove clear the filter
property in design view once you've looked at it.

The help file says the parameter is like an SQL where clause, so it looks
like you need something like

"[FileName].[CallDate] = #" & CallDateLookup & "#"

if the form's data source is a table or

"[QueryName].[CallDate] = #" & CallDateLookup & "#"

if the form's data source is a query.



Jay said:
I'm prettty new to Access, and I've only used Access 2007, so I can't
guarantee this will work, but here goes.
Try CallDate = CallDateLookup.Text or CallDate = CallDateLookup!Text..- Hide quoted text -

- Show quoted text -

Perfect! Thanks!
 

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