Linking the tag with values and returning the appropriate values.

P

pillai

I am trying to get an automated value assiged to a particular tag in access.
There are some different types of tags, where as i have to get an automated
value of the specific tags.
For eg:

Tags: ( which will be entered)
ORANGE, APPLE,MANGO,PLUM,GRAPES etc.

And access should return the value in appropriate columns
Orange = ( A=3,D= 5, F=1)
Apple = ( B=2, E=1, F=2)
Mango = ( C= 4, F=1, G=2, I=4)
Plum = ( A= 5, B=1, D=2, H=4)
Grapes = ( C= 2, F=4, G=5, I=4)
The alphabets are the columns and the values should come in appropriate
columns as we enter the name of these fruits.
and this values shall be given in some other table and i have to get it in
the form i am using.
Can any body help how i can do this
 
A

Al Campagna

Pillai,
Not sure I understand...
A control's Tag property is associated with that field, not any specific
value that that field might have.
In a field called Fruit, with a Tag = "Orange", every fruit entered in
that field will have "Orange" as it's Tag value.

Seems as though what you need is... on the AfterUpdate event of Fruit...
is a Case Select (or IIF statement.)
Select Case Fruit
Case "Orange"
A = 4
D = 5
F = 1
Case "Apple"
B = 2
E = 1
F = 2
etc... for each possible Fruit value
End Select

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
P

pillai

Thanks for your response,
A, B,C,D ... are the columns, and as on entering the name of fruit i need
the values assigned for the appropriate fruits to the assigned assigned value.
thanks
 
J

John Spencer

It seems to me that you should have a table with
FruitStandard - table name
FruitName - unique values only
ColA
ColB
ColC
ColD

And in this table you should have ONE record for each fruit with the
relevant values entered in columns a to z.

In your Current table you only have FruitName.

Your underlying query would link the two tables together on the FruitName
fields. When you enter Apple in the current table, the query will
automatically DISPLAY the linked values for the columns in FruitStandard.

The underlying query would look something like the following.

SELECT Current.FruitName
, FruitStandard.ColA
, FruitStandard.ColB
, FruitStandard.ColC
FROM Current INNER JOIN FruitStandard
ON Current.FruitName = FruitStandard.FruitName

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
A

Al Campagna

pillai,
Given a table of...
Fruit Text
A Num
B Num
C Num
etc....
My sample code will work.
If you enter "Orange" in Fruit,
Field A is set to 4
Field D is set to 5
Field F is set to 1
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
P

pillai

Ya that is what i require. I could do the same in excel if you want i can
send you the fiile. I dont know how to attach the file here. if you can send
me your mail id i can mail you. My mail id is (e-mail address removed)
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top