Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Closing date problem (2002)

    I'm trying to establish a field/constant/variable (not sure which) for my database that will serve as a "closing date" to prevent entry of data with dates prior to this date.

    The way I have it now is cumbersome. In the Edit Tickets FORM (date field) and the Paste import QUERY I have established limitations for the date. Unfortunately, this requires ME to recode the form and query for the closing date every time it needs updating. I was hoping to be able to set the date at some higher level so that another user can enter the closing date but obviously. I tried adding a table called Constants to hold the closing date and then refer to that field from the Query/Form, but that doesn't work.

    Another thing I was attempting was to set the title on the switchboard to the Title field in the Constants table. That didn't work either. I have a feeling that what I'm trying to do requires Visual Basic, which I dont' know very well.

    I need some serious help, please.
    Attached Files Attached Files

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

    Re: Closing date problem (2002)

    You should change the data type for the ValidDate field in the Constants table to Date/Time.

    Your idea for the Paste import to Delv Tick query was OK, only you put [Constant].[ValidDate] as criteria instead of [Constants].[ValidDate] - you need to use the exact name of the table.

    In the Validation rule for the text box on the form, use
    <pre>>DLookUp("ValidDate","Constants")
    </pre>

    You can set the Control Source of the text box on the switchboard form to
    <pre>=DLookUp("Title","Constants")
    </pre>

    The form of DLookup used here looks up the value of the field specified in the first argument in the table/query specified in the second argument. Since the Constants table has only one record, there is no ambiguity. If you want to retrieve a value from a specific record in a table/query with multiple records, you can supply an optional third argument: a where-condition, for example:
    <pre>=DLookup("GrowerID","Delivery Ticket","TicketID=32162")
    </pre>

    You can find more information about DLookup in the online help in the Visual Basic Editor:
    - Press Alt+F11 to activate the Visual Basic Editor.
    - Press Ctrl+G to activate the Immediate window.
    - Type dlookup
    - Press F1 to activate the help window.

  3. #3
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Closing date problem (2002)

    Thanks for your input Hans. I'll try it first thing tomorrow morning and let you know how it goes.

  4. #4
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Closing date problem (2002)

    Hanz, I just wanted to let you know that I really appreciate the help. Of course when I made the changes you suggested it worked like a charm. Slowly but surely, I'm getting this database exactly how I want it.

Posting Permissions

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