Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How write value of field on a form to a table field

Posted on 2013-02-07
1
Medium Priority
?
224 Views
Last Modified: 2013-02-07
I have a form named frmDocs.  On the form is a field named "txtEmail".  The value of the field came from a query using tblContacts.

When the user changes the populated value in the field I want to update the field in tblContacts named txtEmail to be what the user changed it to by clicking a command button named cmdUpdateEmail.

What would the onclick event be for the command button?
0
Comment
Question by:SteveL13
1 Comment
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 38865286
Something like this (with your own names):

dim s as string
s = "UPDATE tblContacts SET txtEmail = '" & Me.txtEmail & "' WHERE ContactID = " & Me.ContactID
currentdb.execute s, dbfailonerror

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question