Solved

Excel or Access, to automatically fill value based on previous entered data

Posted on 2011-09-20
7
389 Views
Last Modified: 2012-05-12
Hello.
I would like to do the following:
I have a list of values in a column of a table (Column Name: CODES). I must manually enter the correct correspondent code in a second comumn (Column Name: KEN).
After that I would like whenever I add a value in CODES (manually or as an import from another list), to have Excel or Access to automatically fill in the correct correspondent value in KEN column if there is one previously added.

Any answer is welcome.
Regards
 
 
 KEN.xls KEN.xls
0
Comment
Question by:inspironcrk
[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
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36566222
In Access, your table field Ken can be a combo box with a query that looks for distinct rows of Ken and Codes with the Codes feld as the filter criteria.   This will return any Ken values entered for a specific Code.
See attached db
Database41.accdb
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 36566339
You could set the KEN column to be a lookup of the CODE in the cells above, use a mixture of absolute and relative row references to define the cells above, top row would be absolute, row immediately above would be relative and would therefore move as the formula is copied down.

The user would then only have to input the KEN value for the first occurence of the CODE, overwriting the formula in doing so.

Thanks
Rob H
0
 

Author Comment

by:inspironcrk
ID: 36566659
@ DoDahD: I will try it right now

@robhenson: Can you be more specific? I am very rookie in coding...

Thank you
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:inspironcrk
ID: 36566695
@ DoDahD:

Thanks for the effort. I have the following remarks: Because there will be one to one relationship between the cells, I would like the program to automatically add the correct correspondent value if there is one.

As for the form is not the optimal way to enter the CODES, since I will import them from other tables.

Is it clear?

Regards,
Niktias
0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36566758
since I will import them from other tables:   You can use an update query to fill the Ken values if you only have one Ken value for each Code.
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 250 total points
ID: 36566826
See attached on List2.

I have put formula in column C from row 9 downwards.

You will see that the formula in rows 9 & 11 pull the relevant KEN value from the cells above.

Whereas, the formulaw in rows 10 & 12 give a #N/A error value because they are the first occurence. For the first occurence of a code, type the KEN code in manually and then future occurences in the list will be populated by the formula.

This could be done with a VBA routine instead if so required, checking for input in column B and checking for previous occurences of the code, populating column C accordingly or requesting a code for a new occurence.

Hope this helps.
Rob H KEN.xls
0
 

Author Closing Comment

by:inspironcrk
ID: 36566881
Thank you all. I prefer the excel answer since it is easier for me to handle.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

730 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