Discussion Locked

Auto fill a access form field

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

In Access 2000, I want to look in a form field and apply a value to another field in the same form based on what is entered in the first field. For example:
If field A=1
Then field B=Matt

The value of field B is not a lookup from another table.It is only dependent on what the user enters in Field A. What is the easiest way to accomplish this?

T.I.A.

2 replies

by karpi

Hello,

in this case I would use code in the AfterUpdate-Event-Procedure of field A

example

Sub A_AfterUpdate()

Select case me.a
case 1
me.b="Matt"
case 2
me.b="..."

case else me.b="N/N"

end select

end sub

HTH
Karpi

by dakota99

Hi,
Thanks so much or your help. I am definitely a novice at the coding. I understand most of the example you gave. There are just 2 things I need a little clarification on.
1. What does the Me in "Me.b" stand for?
2. In the line "me.b="N/N"" what is the "N/N" mean?
Thanks Again

This discussion is closed to new replies.