Field consisting of first character of another field

  • Thread starter Thread starter markb
  • Start date Start date
M

markb

Hi folks,

I have a field called "Name". I have another field called "SectionID". I
want SectionID to auto-populate with the first letter of the name entered in
the Name field. I have tried =Left$([Name],1) in the SectionID's Default
Value, Validation Rule properties in design view. Did not work. Can you
please help.

I have done VBA in Excel, but not in Access. If I need to do so, I am not
sure how to begin.

Thanks
 
Hi -

Are you referring to the Validation Rule and Default Value properties of a
form text box or a table field?
You cannot accomplish what you are trying to do in table design - you will
need a form.

Which are you referring to?

John


Hi folks,

I have a field called "Name". I have another field called "SectionID". I
want SectionID to auto-populate with the first letter of the name entered in
the Name field. I have tried =Left$([Name],1) in the SectionID's Default
Value, Validation Rule properties in design view. Did not work. Can you
please help.

I have done VBA in Excel, but not in Access. If I need to do so, I am not
sure how to begin.

Thanks

--
John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Message posted via AccessMonster.com
 
Hi folks,

I have a field called "Name". I have another field called "SectionID". I
want SectionID to auto-populate with the first letter of the name entered in
the Name field. I have tried =Left$([Name],1) in the SectionID's Default
Value, Validation Rule properties in design view. Did not work. Can you
please help.

I have done VBA in Excel, but not in Access. If I need to do so, I am not
sure how to begin.

Thanks

In addition to J_Goddard's comments, if you really do have a field
named 'Name', Name is a reserved Access keyword and should not be used
as a field name.
For more information, see ..
http://www.allenbrowne.com/AppIssueBadWord.html

Why in the world do you need a field populated with the first
character of another field's value?

What do you do if/when the value in the 'name' field is changed. You
now have incorrect data in the SectionID field.

Anytime you need that information simply use an unbound control
=Left([FieldName],1).
This character need not (should not) be stored.
 
Back
Top