Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter by date (Access 2000)

    I have a form in the form of a table where the first field is the day, called calls.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter by date (Access 2000)

    Click in a date, then do the following:
    - Click the Filter by Selection button on the toolbar
    or
    - Select Records | Filter | Filter by Selection
    or
    - Right-click in the field, and select Filter by Selection from the popup menu.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by date (Access 2000)

    Thank you. Regret i cannot do it. I cannot find the button filter by selection. I expect to find in on the toolba Form Design but it isnt there?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter by date (Access 2000)

    The button is on the Form View toolbar. It is only available when you're viewing the data, not when you're in design view.

  5. #5
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by date (Access 2000)

    Thank you very much for your patience and you quick reply.Then the use is not appropriate to me since it is not user friendly. I have tried to use the filter but i get syntax error :
    Private Sub dayClick()
    Me.Filter = "[day]=" & Me![day]
    Me.FilterOn = True
    End Sub

    Will you help ?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter by date (Access 2000)

    I disagree. Clicking a toolbar button is very easy and user-friendly.

    Is this the On Click event procedure for the text box bound to Day? If so, its name should be Day_Click, not DayClick.
    Change the line

    Me.Filter = "[day]=" & Me![day]

    to

    Me.Filter = "[day]=#" & Format(Me![day], "mm/dd/yyyy") & "#"

    I strongly recommend against doing this, for it would mean that the form would be filtered each time the user clicks in the Day, even if the user clicks there for another reason, for example to edit the date. So it is not user-friendly.

  7. #7
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by date (Access 2000)

    Thank you for your reply.You are right in principle, but i need to use it in a survey, when the user does not edit data but only analyzes them. Howver i am at the point of despair, since again i get these damned syntax errors.I am sure the errors are somewhere in my regional settings, for example the days begin with the number of the day and not the month, but anyway i cannot solve it. Would you have a look in my stripped database? No wonder you might find some medicine

    Kind regards

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter by date (Access 2000)

    The problem is not caused by the form or its code (both are OK), but by the query. The Day field occurs twice in the query: once as part of Calls.* and once as a separate column used to specify the sort order. As a result, Access doesn't know which of the two occurrences you mean. The solution is to clear the Show check box for the separate Day column in the query. The column will still be used to specify the sort order, but it won't be displayed any more. See the attached version.

  9. #9
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by date (Access 2000)

    Thank you so much for the kind attention.This damned syntax error continues to appear even with your attachement.It appears even when i set the source not as a query but as a table. If the fault lies with the computer then i would better leave it

    kind regardss

    samotek

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter by date (Access 2000)

    Does this new version work for you? I removed some superfluous items.

  11. #11
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by date (Access 2000)

    Yes, thank you. It works fine now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •