Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    USA
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Filling a field (A2K)

    Ok, here is the senario. I have a date field that needs to be filled in by the user. I have another date field that needs to automatically fill with the date 90 days after the date in the first field. For example, I have a Date File Recieved field and after entering a date the File Pending Date needs to be 90 days after that. Also once the date passes the date in the File Pending area I need it to check the file closed box so that when i run a query it shows that record as inactive and so the user doesn't have to worry about going in and checking it all the time. It would save us much time. I appreciate any help offered, and heck if your around my area I'll treat you to lunch or some such. Well back to work on other things while I think on this problem myself.

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

    Re: Auto Filling a field (A2K)

    You don't need to keep the File Pending Date and the File Closed in a table. You can calculate them in a query. In a query, you can add calculated fields:

    File Pending Date: [Date File Received] + 90
    File Closed: [File Pending Date] > Date()

    Then you can treat these as if they were fields in a table (but you can't modify them, which is as it should be). You can use them in other queries, forms and reports.

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    USA
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Filling a field (A2K)

    Thanks for the advice once again Hans, but unfortunately I am not using a query with this form. Here is what I did to get it to work though. This is the code I used.

    Private Sub txtOpenDate_LostFocus()

    txtCalDate = txtOpenDate + 90

    Dim nowDate As Date
    nowDate = Date
    If nowDate > txtCalDate Then
    chkFileClosed.Value = Checked
    End If

    End Sub

Posting Permissions

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