Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dates that do not coincide with a calendar year (Access 2000)

    One of the problems that I have had in the past is inputting dates for a tax year. As you may know the British tax year runs from 06/04/xx to 05/04/yy.

    In the past it has meant me searching in a query for the required date period with say:- Between [Enter the start of tax year] and [Enter the end of the Tax year].

    This is fine, but it means every time you want to use it you have to type say 06/04/03 then 05/04/04, which to say the least is a pain.

    I
    Attached Files Attached Files

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

    Re: Dates that do not coincide with a calendar year (Access 2000)

    Michael,

    Thanks for sharing. I'm sure this will be useful to Loungers!

    I have taken the liberty of posting a variant that allows you to select the tax year from a combo box on the form itself. All credit still goes to you, of course.
    Attached Files Attached Files

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dates that do not coincide with a calendar year (Access 2000)

    Thanks Hans

    A great improvement on my demo.

    The problem started when I was trying to print out a report for a tax year, So now can you think of a way of doing your Combo magic on a report. That really would put the icing on the cake!

    Michael

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

    Re: Dates that do not coincide with a calendar year (Access 2000)

    A report is not interactive, so a combo box on a report will not work. But you can use a combo box on a form (such as in my version of your demo) to filter a report. Just put a command button on the from that opens the report; you can use the command button wizard to create it, or write the On Click code yourself:

    Private Sub cmdReport_Click()
    On Error GoTo ErrHandler
    DoCmd.OpenReport "rptMyReport", acViewPreview
    Exit Sub

    ErrHandler:
    If Not Err = 2501 Then ' Ignore canceling the report
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

    where cmdReport is the name of the command button and rptMyReport is the name of the report.

Posting Permissions

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