Results 1 to 5 of 5
  1. #1
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63

    How to UPDATE table from textbox on form

    I am trying to update a table's field from a text box on a form.... I'm using this code which is not working... any clues? Thanks!:



    Private Sub Command125_Click()
    DoCmd.RunSQL "UPDATE tblFinals SET ChangeOrdersInTransit = Me.txtStatementBalance"
    End Sub

  2. #2
    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
    Update queries can be unforgiving.
    This would update all records to Me.txtStatementBalance
    If this is a text field then

    Code:
    Private Sub Command125_Click()
          DoCmd.RunSQL "UPDATE tblFinals SET ChangeOrdersInTransit = '" & Me.txtStatementBalance &"'"
    End Sub

  3. #3
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63
    What if instead of a textbox it is pulling data form a subform called Child99?

  4. #4
    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
    How come you're changing the question?

    How about clearly stating WHAT you want to do in plain English?

  5. #5
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by BrockWade View Post
    What if instead of a textbox it is pulling data form a subform called Child99?

    Then Me.child99.txtStatementBalance

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

Similar Threads

  1. Replies: 2
    Last Post: 01-08-2014, 05:18 PM
  2. Replies: 2
    Last Post: 08-12-2013, 05:47 PM
  3. Replies: 7
    Last Post: 09-21-2012, 11:09 AM
  4. Replies: 13
    Last Post: 02-07-2012, 04:09 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