By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 2,606 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Updating a Table from VBA

100+
P: 116
I'm trying to to update columns in a table in access from values entered in a form. I think my code is bombing because it doesn't know the table i'm trying to update. Does anyone know the syntax to point to an access table? (In this case tblWORK_DETAIL) This is a simplified version of what i'm trying to do.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL ("Update " & tblWORK_DETAIL & "Set BUILD_NAME = " & Me.cboBUILD_NAME)
  2.  
Thanks
Eric
Dec 14 '07 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,315
I'm trying to to update columns in a table in access from values entered in a form. I think my code is bombing because it doesn't know the table i'm trying to update. Does anyone know the syntax to point to an access table? (In this case tblWORK_DETAIL) This is a simplified version of what i'm trying to do.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL ("Update " & tblWORK_DETAIL & "Set BUILD_NAME = " & Me.cboBUILD_NAME)
  2.  
Thanks
Eric
Assuming your table is named tblWORK_DETAIL, BUILD_NAME is text, and you want to update every record then you use:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunSQL "Update tblWORK_DETAIL Set BUILD_NAME = '" & Me.cboBUILD_NAME & "'"
  2.  
Dec 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.