Access 2003 Form fields Sync

15 pts.
Tags:
Access 2003 forms
Microsoft Access
Microsoft Access 2003
Office 2003
Hello, I am turning to you as a last resort :/ Here is the case, thought it looked simple to me at first... : I have a field which needs to be updated according to another field in a form according to the date in a table: Table contains [KEY, field1, field2] and the form uses to updated a different table by using KEY as a foreign key. So when I choose KEY from a combo box in the form I have two other fields that need to desplay (only) the values in field1 and field2 according to table 1. How do I do that? :/

Answer Wiki

Thanks. We'll let you know when a new response is added.

There are number of methods you can use.

For example, if you have two fields called txtTest1 and txtTest2 and you want to update txtTest2 every time txtTest1 is modified you can use code to chage the value as shown below…

Private Sub txtTest1_AfterUpdate()
Me!txtTest2 = Me!txtTest1 ‘Update txtTest2 field on this form with value from txtTest1 field
End Sub

With this method you will be abe to modify the value in txtTest2 independetly as well.

Another method you could use is to link txtTest2 Control Source to txtTest1 as shown below…

1) Click on Properties
2) Click Data tab
3) Enter =[txtTest1] in the Control Source field so it looks like this

Control Source ………..=[txtTest1]

This will link two values, however, you will not be able to modify the value in txtTest2 independetly with this method. It will be locked for editing.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Arielnavon
    Very well. Thanks a bunch! I was familiar with the macro option but didnt think about using code procedure. So if Me!txtTest1 is a foreign key in a table (e.g. Tbl.key) and I would like to grab other value from that table (e.g. Tbl.value2 ), to go in Me!txtTest2, will the following work - - Private Sub txtTest1_AfterUpdate() Me!txtTest2 = Select Tbl.value1 from Tbl where Tbl.key = Me!txtTest1 End Sub ? BTW, where do I update / write this sub? go to any "code" option will do?.. Many thanks again~
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following