if statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have created an access table and i'm now in the from that i designed. in
one of the data entry fields named "name" i'm trying to use an if statement
so that when a user enters the first initial of his first name (validation
text will ask user to enter this info) when he enters "i" for example i want
access to enter his full name in this field
if initial = "i" then
"i" = india
what is the code that i need to write in expression builder to accomplish
this?
thanks
 
Where is "India" coming from? Will "I" always be "India"? If "I" will always
be "India", you could use a Select Case statement in the control's
AfterUpdate event to change the value to what you desire. If "India" comes
from previous entries in that field, then I would use a combo box instead.
Fill the Row Source of the combo box with the unique values that currently
exist in that field and have the combo box's Auto Expand property set to
Yes.

Also, a field called "Name" is not recommended. Name is a reserved word. A
field called FirstName would be better.
 
For starters, a field named "name" is going to cause problems since "Name"
is a built in property of virtually every object. I would highly recommend
renaming the field to something more meaningful (and distinct) like
CustName.

To get the effect you want you need to look at combo boxes. This is exactly
what they do - look at help for them and also look at the Northwind database
to see some examples of how they are used.
 

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

Back
Top