Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Thanked 0 Times in 0 Posts

    Spoke too soon (2000 SP3)

    I needed a way to set default start and end dates for queries and have had this going beautifully (thanks to Hans) for over a month. Today it decided to play up. Default dates last for 1 "occassion" eg one running of a query, then the dates are reset to 1899. I dont know what I have done wrong but appreciate any help.

    Symptons are:
    I set the default start and end dates using a pop up input box on my switchboard (see code below)
    This works once then I get a Runtime error 11 Division by zero
    When I check my default dates, they have been reset to 1899

    Code is

    Option Compare Database

    Public DefaultStartDate As Date
    Public DefaultEndDate As Date
    Public Sub SetDefaultStartDate()
    DefaultStartDate = InputBox("Enter Default StartDate")
    End Sub
    Public Function GetDefaultStartDate() As Date
    GetDefaultStartDate = DefaultStartDate
    End Function
    Public Sub SetDefaultEndDate()
    DefaultEndDate = InputBox("Enter Default End Date")
    End Sub
    Public Function GetDefaultEndDate() As Date
    GetDefaultEndDate = DefaultEndDate
    End Function

    Have done a compact and Repair with no effect

    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Spoke too soon (2000 SP3)

    I don't understand. At what point do the SetDefaultStartDate and SetDefaultEndDate routines get called? Does the query call just the Get routines? If so, then when are the Set routines called? The 1899 date is the default you get when zero is evaluated as a date.

Posting Permissions

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