Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic completion of fields (2000)

    When l enter a new record and click on the drop down menu for some odd reason the "Date Given Owner" field does not
    display the date automatically.
    I have a VB procedure to do this but some reason it is not working.
    Also l would like a date to automatically go into the "Date Reminder Due" field, altough not if todays date is on a Friday.

    Any assistance would be appreciated.
    see screenshot for details.



    Justin.

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

    Re: Automatic completion of fields (2000)

    If you want the Date Given to Owner field to contain the current date when you create a new record, set its Default Value property to <code>Date()</code> in the design of the table (or of the form).

    You can use the Before Insert event of the form to set a date in the Date Reminder Due text box conditionally, but which date do you want? Any date?

  3. #3
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic completion of fields (2000)

    The Date Given field worked fine, thanks.

    The date l want to use in the "Date Reminder Due" field is always a Friday,altough if the "Date Given Field" is also a Friday then the "Date Reminder Due" needs to be the following Friday, if you see what l mean.

    Justin

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

    Re: Automatic completion of fields (2000)

    OK, you don't need code for that. Set the Default Value for this field to

    <code>Date()+8-Weekday(Date(),6)</code>

    Thw Weekday function with second argument 6 (vbFriday) returns 1 for Friday, 2 for Saturday, ..., 7 for Thursday. We add 8 days to the current date, then subtract this weekday number.

  5. #5
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic completion of fields (2000)

    That's great, thanks.

    Justin

Posting Permissions

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