How change value in a table when change value in a form not bound to that table

Posted on 2011-04-22
Medium Priority
Last Modified: 2012-05-11
I have a form which is bound to a table, "tblJobScheduleHeader".  On this form is a field named "txtJobN" and the control source for this field is JobN which is a number field.  The form, by default, opens with txtJobN with 99999999 as the data in that field.  When the user changes this number to another number, say 123456, I want the following to happen...

Find, in "tblOutside Purchase", any record with 99999999 in the field JobN and change it to 123456.

How can this be done.  I would like it to happen in an afterupdate event of the field "txtJobN"

Question by:SteveL13
1 Comment
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 35448673
private sub txtJobN_afterupdate()

currentdb.execute "update [tblOutside Purchase] set JobN=" & me.txtJobN & " where JobN=99999999"

end sub

Featured Post

Independent Software Vendors: 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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

571 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