Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What about .Refresh?

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Where would that go exactly? If the AfterUpdate event doesn't fire, .Refresh isn't going to be executed,right?

  3. #18
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by orange View Post
    Where would that go exactly? If the AfterUpdate event doesn't fire, .Refresh isn't going to be executed,right?
    Yah, and both controls are unbound. I was imagining the value was in the table.

    I tested the following in the On Exit event.


    Code:
    Private Sub Text0_Exit(Cancel As Integer)
    Dim dtCalc As Date
    dtCalc = Me.Text0.Value + 2
    Me.Text2.Value = dtCalc
    End Sub
    It worked. Nothing unexpected happened.

    Then I built a function

    Code:
    Private Function What_Date(dtCalc As Date)
        dtCalc = Me.Text0.Value + 2
        Me.Text2.Value = dtCalc
    End Function
    and called it in the On Exit

    Code:
    Private Sub Text0_Exit(Cancel As Integer)
    Call What_Date(Me.Text0.Value)
    End Sub
    And that worked too. So, I am still confused.

  4. #19
    Ellpee is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Posts
    80
    Different ways of skinning the same cat, I guess. Thing is, in my simple mind it seems to me if I change whatever is in Box 1 and leave that control, whether via tab or enter or click-somewhere-else or whatever, that ought to trigger an AfterUpdate event where I can do whatever I need to (within reason) to other controls on the same form. In the real world I'm good to go, my workaround is doing what I need, but will keep monitoring this thread to see if anybody else has better ideas or a better grasp of the whole event-sequence logic for Access Forms.

  5. #20
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You are going to need to set focus somewhere. On Change won't work because you need a date value. On Dirty might work if it was a bound control.

    Bottom line the control does not update until after it loses focus. You need to cause another control to become "Active" and it seems the user will have to cause another control to become active.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Updating one box from another
    By Sumo in forum Forms
    Replies: 1
    Last Post: 09-27-2013, 09:42 AM
  2. Updating
    By stefan200593 in forum Access
    Replies: 1
    Last Post: 03-31-2013, 09:37 PM
  3. Replies: 1
    Last Post: 12-19-2011, 12:16 PM
  4. check textbox1 on each record of report
    By sconard in forum Access
    Replies: 8
    Last Post: 04-13-2011, 12:26 PM
  5. FE & BE Updating
    By mastromb in forum Access
    Replies: 5
    Last Post: 02-12-2010, 11:55 AM

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