Results 1 to 2 of 2
  1. #1
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65

    AfterUpdate/OnChange not working

    Hi



    I have a form with two fields, both have a little button associated which brings up a calendar form (downloaded from http://allenbrowne.com/) for them to choose a date.

    The first one is bound to a field in the table the form is based on, but the second one is unbound.

    When the user chooses a date on the first one, I want the second one to default to the same date.

    In other words, it's for booking leave - the first is the start date, the second is the end, but i want it to default to one day.

    I have put the code below on the AfterUpdate or OnChange events and neither seems to work. Any ideas?

    Code:
      
    Private Sub txtDateFrom_AfterUpdate()
    Me.txtDateTo.Value = Me.txtDateFrom.Value
    End Sub
    Thanks
    Chris

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try putting your code in the OnExit event of txtDateFrom. The events you are using do not fire when code is used to complete the control.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. AfterUpdate not firing
    By newvb in forum Forms
    Replies: 4
    Last Post: 09-29-2011, 04:55 AM
  2. AfterUpdate event help
    By 10 Gauge in forum Forms
    Replies: 11
    Last Post: 09-08-2011, 10:04 AM
  3. Add date OnChange Event - A to Z Walk Through
    By JeffG3209 in forum Programming
    Replies: 7
    Last Post: 08-12-2011, 04:40 PM
  4. Understanding afterupdate
    By MAM8433 in forum Access
    Replies: 8
    Last Post: 05-23-2011, 02:05 PM
  5. Replies: 1
    Last Post: 06-22-2010, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums