• Auto Filling a field (A2K)

    • This topic has 2 replies, 2 voices, and was last updated 23 years ago.
    Author
    Topic
    #371502

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #590668

      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.

      • #590681

        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

    Viewing 0 reply threads
    Reply To: Auto Filling a field (A2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: