Solved

How to modify multiple field of an access table

Posted on 2013-01-14
5
352 Views
Last Modified: 2013-01-17
Hi Exparts,

I used the following VBA code to modify a table field:
Currentdb.execute "Update tblTarget_sr INNER JOIN tblMerged_test ON tblTarget_sr.[Customer Part]=tblMerged_test.[Part No] SET tblTarget_sr[Target total time]=tblMerged_test.[total time]

But I have more three fields in Update tblTarget_sr that need to modified at the same time while the above condition met.

Please advise me what would be the VBA code to modify other fields.

Thanks
0
Comment
Question by:alam747
  • 3
  • 2
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 38776803
Just add them to the SET clause like this:

Update tblTarget_sr INNER JOIN tblMerged_test ON tblTarget_sr.[Customer Part]=tblMerged_test.[Part No] SET tblTarget_sr[Target total time]=tblMerged_test.[total time], Field2 = abc, Field3 = XYZ, Field4 = NNN, etc..

Open in new window

0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 38776807
In VBA:

Currentdb.execute "Update tblTarget_sr INNER JOIN tblMerged_test ON tblTarget_sr.[Customer Part]=tblMerged_test.[Part No] SET tblTarget_sr.[Target total time]=tblMerged_test.[total time], tblTarget_sr.[Field2]  = abc, tblTarget_sr.[Field3] = XYZ, tblTarget_sr.[Field4] = NNN, etc.."

Open in new window

0
 

Author Comment

by:alam747
ID: 38785492
Thanks for your prompt response.

I have several field to update therefore its too long, I used _ (a space and underscore but its giving me compile error.
Is there anything need to do like shift key or anything else.

Thanks
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38785533
Post your Code here and I'll see if I can help out...
0
 

Author Closing Comment

by:alam747
ID: 38790760
Thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Programmer 14 46
Can not open the Access Help ? 3 52
Where should Group Policies be windows server 2016? 4 28
Microsoft Office Licensing Question 2 24
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

815 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now