Results 1 to 5 of 5
  1. #1
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112

    Why is text box not updating?

    I have a form named frmPaymentDetails.

    I have the following controls on this form:
    [DefaultFees] - Text box. Control source is taken from a field in a Table.

    [AmountPaid] - Unbound text box control.

    Problem:
    I update the value in DefaultFees by manually typing a new value in the text box. And then I hit a button which calls a subroutine.



    Private Sub DefaultFeeUpdateButton_Click()
    ' Refresh the [Amount Paid] text box
    Me.AmountPaid.Value = Me.DefaultFees.Value
    Me.AmountPaid.Requery
    End Sub

    However, inside the subroutine, Me.DefaultFees.Value shows the old value, which I've already overwritten in the text box manually. It is not reading in the new value which I typed.

    What is the problem?

    Thanks.

  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
    Have you tried putting your code in the AfterUpdate event of the DefaultFees control?

  3. #3
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Quote Originally Posted by RuralGuy View Post
    Have you tried putting your code in the AfterUpdate event of the DefaultFees control?
    Hi RuralGuy
    I'll give it a try. Thanks.

    But if anyone else has an idea to make the button work, I'll appreciate it. It more closely meets the needs of the user.

  4. #4
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    You may also need a Refresh command after updating the value. This will refresh the form.

  5. #5
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Quote Originally Posted by pkstormy View Post
    You may also need a Refresh command after updating the value. This will refresh the form.
    Bingo! It works exactly as expected now! Thanks!

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

Similar Threads

  1. Replies: 4
    Last Post: 02-14-2011, 09:11 AM
  2. Replies: 1
    Last Post: 11-05-2010, 04:31 PM
  3. How to vertically align text inside a text box ?
    By alexcalgary in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 08:44 AM
  4. Replies: 15
    Last Post: 09-18-2010, 01:19 PM
  5. Split text field into two text fields
    By Grant in forum Access
    Replies: 6
    Last Post: 01-31-2008, 05:52 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