Initial

C

casih

I have a form containing personal details. Included in this form are fields
First Name, Initial & Surname. Is there anyway that Once I have entered a
first name in the box access will automatically enter the initial for me.
i.e. Entering "Casi" would ensure that the "Initial" is filled in with C?
 
R

RonaldoOneNil

In the After Update event of the Firstname field put this code

If Len(Me.Firstname & "") > 0 Then
Me.Initial = Left(Me.Firstname,1)
End if
 
K

KARL DEWEY

Most folks would use a field named Initial for the middle name initial.
There is no need to have a field for first name initial as it can be pulled
by Left([FName],1) to extract the first letter of the first
name.
 
T

Tom van Stiphout

On Fri, 21 Aug 2009 06:10:01 -0700, casih

Yes. Write this in the firstname control's AfterUpdate event:
myInitial.Value = Left$(myFirstName,1)
(of course you replace myObjectNames with yours)

This will populate the Initial field, but also allow you to override
it. If overriding is never needed, the Initial field is not needed
because it can be calculated.

-Tom.
Microsoft Access MVP
 
C

casih

I have tried entering this code but keep getting the error message Block if
without End If) - Help!!!
 
J

John W. Vinson

I have tried entering this code but keep getting the error message Block if
without End If) - Help!!!

Post your COMPLETE code. The three lines below are OK - there must be an error
elsewhere.
 

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