Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Location
    London, Gtr London, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating date (2000)

    Before I ask my question, please excuse my ignorance - I am trying to teach myself Access!
    I have created a database with a field for the date modified.
    I have figured out how to insert the date when a record is created.
    I have a button on my form, and when I click the button, I wish it to update the 'date modified' field.
    Thanks in advance!

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

    Re: Updating date (2000)

    I assume you have a field Date Modified in a table, and a form based on that table. The following is based on that assumption. If it is wrong, please post back with a description of your situation.

    Place a text box on the form bound to the Date Modified field. To do this, you can drag the field from the list of fields (View/Field List) to the form, or you can click on the Text Box icon ab| in the control toolbox (View/Toolbox), then click on the form, and set the Control Source property to the name of the Date Modified field. Name this text box txtDateModified. If you wish, you can hide it by setting the Visible property to No.

    You already have a command button on this form. Let's say it is named cmdUpdate for illustration purposes. Select this button, click the Events tab of the properties window. In the OnClick event, select Event Procedure, then click the builder button (the button with the three dots ...) to the right of it.

    You'll be taken to the Visual Basic Editor, with a skeleton for the event procedure already created for you:

    Private Sub cmdUpdate_Click()

    End Sub

    The blinking cursor is in the empty line in between. Hit the Tab key, and type Me.txtModifiedDate = Date, so that the event procedure looks like

    Private Sub cmdUpdate_Click()
    Me.[txtModifiedDate] = Date
    End Sub

    Now return to Access, and close and save the form. Open it in Form view to test the button.

    Note: substitute the actual names you use for the ones I used in this example.

  3. #3
    New Lounger
    Join Date
    Dec 2002
    Location
    London, Gtr London, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating date (2000)

    Hans,
    You are wonderful!
    It works like a charm.
    Thank you very much.

    D you think that you could you assist me with the 'translation' of my query (following):

    SELECT tbl_address.Display_Name, tbl_address.Email, tbl_address.Updated, tbl_address.Removed, tbl_address.Address_Wrong, tbl_address.[list])=3)) AND (((tbl_address.Removed)=True) OR ((tbl_address.Address_Wrong)=True))
    ORDER BY tbl_address.Updated DESC;

    I'm hoping it means that the query will show 6 items from my table if:
    the "list-type" is '3'; and either the "address_removed" and/or the "address_wrong" is true.


    Thanks again,
    Best Regards,
    Alan.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Updating date (2000)

    Your query looks fine, why don't you run it and see if it returns the 6 items you expect.
    Your interpretation of what the query will return seems fine to me.
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  5. #5
    New Lounger
    Join Date
    Dec 2002
    Location
    London, Gtr London, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating date (2000)

    Fantastic,
    Thanks everybody for your help.

    -Alan.

Posting Permissions

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