Solved

Microsoft Access Macro

Posted on 2013-01-26
4
236 Views
Last Modified: 2013-01-28
Hello,

I have an access file that I have to manually adjust.  I would like to create a macros that automates the changes.
The access file has 7 columns
I need to make changes to column 1 depending on the information of column two.
Then I need to make changes to Column 2 depending on the information in column one.

How can I go about this?

Thank you
0
Comment
Question by:cbones
  • 3
4 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 38822610
Can you give an example of the changes?
0
 

Author Comment

by:cbones
ID: 38822620
Yes, sorry.

If the rows in column one say the data below than column two gets changed to this

column 1                      Column 2
test                                   T
test2                                 T2
data                                  D
data2                                D2

If the rows in column one say test then change column two to T.
If the rows in column one say test1 then change column two to T1
Etc...

But there can be about 15 different criteria.
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38822631
OK, that is changing column 2 based on column 1.  What about your first requirement, change column 1 based on column 2?

It might be easiest in the instance above to make a table of possible values in column 1 and desired values in column 2. Then join that lookup table to your table, and do an update query.
0
 
LVL 26

Accepted Solution

by:
jerryb30 earned 500 total points
ID: 38822664
With the data you posted, at its most simplistic,
UPDATE tblColumns SET tblColumns.Col2 = UCase(Left([col1],1)) & IIf(IsNumeric(Right([col1],1)),Right([col1],1),"");

where the table is named tblColumns
the two fields are named col and col2
Col2 is updated to the leftmost value of col2 and, if the rightmost value of col1 is a number, that number.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

863 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

22 Experts available now in Live!

Get 1:1 Help Now