Results 1 to 8 of 8
  1. #1
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295

    updating a field on a form

    Good day All,



    Textbox9 = Textbox8 * 2 on a form

    When a value is entered into Textbox8 the change is not updated in Textbox9. ,

    How can I get Textbox9 to automatically show the change when a value is entered into Textbox8?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you're doing that in code, you'd have to do it in the after update event of Textbox8. You could also just make the control source of Textbox9:

    = Textbox8 * 2
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295
    Thank Paul; that works fine. However I want TextBox8 = Panel, which is a variable in another module on the same form. I tried passing the variable through the parameter section of the afterUpdate event but that triggers an error.

    I there a way for this to be done?

    George

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you want the variable available to multiple procedures in the same form, declare it at the top of the module before the first procedure.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295
    Thanks again Paul. That works fine also.

    Now another related challenge: How can I get TextBox9 to update in realtime as I enter values in TextBox8 one by one?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    To do that you'd use the change event rather than the after update event. You'd also have to use the .Text property of 8.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295
    Thanks. Once again this has worked perfectly well; however I didn't use the text property of 8; in fact I don't understand it.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What's the code? The only way the change event works is with the .Text property.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 03-21-2016, 07:01 AM
  2. Replies: 7
    Last Post: 03-02-2014, 08:47 PM
  3. Replies: 4
    Last Post: 08-12-2013, 11:00 AM
  4. Help Updating Form Field
    By emarchant in forum Access
    Replies: 3
    Last Post: 10-08-2010, 11:07 AM
  5. Updating Table field from Form
    By Kunuk in forum Access
    Replies: 0
    Last Post: 02-26-2009, 11:41 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