Solved

Microsoft Access Macro

Posted on 2013-01-26
4
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Create Professional Looking Email Signatures

Create "Professional HTML Email Signatures" with ease.
7 Day Money Back Guarantee if not 100% Satisfied.
Affordable - Try it out for 7 Days Totally Risk Free.
Installers provided for over 45 Email clients.
Both Windows & MAC Supported.
Highly Recommended!

Question has a verified solution.

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

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

710 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