Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access: add up pre-specified fields of selected record

Status
Not open for further replies.

JosjaWillems

Technical User
Feb 9, 2011
11
DE
Hello,

I have a little bit of experience in using VB for Excel, but now I'm starting something new in Access. Somehow, using VB in conjunction with Access seems to be much more difficult to me, so please excuse me for being a terrible noob :)

What I'd like the subroutine to do is very simple:
1. A user selects a record and activates the sub with a button
2. The value of "Field1" is added to the current value of "Field2"
3. The value of "Field1" is deleted
4. The value of "Field3" is cut and pasted to "Field4"

I want the data to be manipulated in the same table, because the front-end people enter the nesessary through a form, but before the data is processed, it has to be verified by the back-end peoples. Some of the back-end users tend to make mistakes while manually processing data, so that's why I'd like to automate this.

Thank you in advance!

Josh
 



Hi,

Could you give an example of the fields that you are adding, deleting and pasting?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


Users should hot be manipulating data directly in tables. Use a FORM to interface the user and provide proper procedural results.

Formu702

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Then you may assume that I'm using forms. Now I will reiterate my question:

Data is added in Field B. How can I programmatically add the value of Field B to the current value of Field A and delete the value of Field B afterwards?
 
Josh
If this is Access why aren't you using SQL or Update reports to do this?

1st SQL:
UPDATE TableX SET Table2.Field2 = [Field1]+[Field2], Table2.Field4 = [Field3];
2nd SQL:
UPDATE TableX SET Table2.Field1 = 0, Table2.Field3 = 0;

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top