Default Value

S

Sash

I'm trying to default the value of one field on my form to the left 32
characters of another field on my form. I tried keying the following in
"Default Value" on the field I'm trying to get the left 32.

=Left(Me![Item_Name_PMM],32)

Access keeps changing it to the following and it doesn't work.

=Left([Me]![Item_Name_PMM],32)

What am I doing wrong?
 
D

Douglas J. Steele

I don't believe you can set the default value to a function call like that,
but try

=Left([Item_Name_PMM],32)
 
L

Linq Adams via AccessMonster.com

This is just a guess, and maybe I'm wrong, but a lot of people get confused
about what a Default Value does. The Default Value is assigned when a new
record is created, i.e. before you've filled out

Item_Name_PMM

on your new record. So if you want one field in a given record to equal the
left 32 characters of Item_Name_PMM ***in that same record*** you're going
about it the wrong way. If this is what you're after, you need something like
this:

Private Sub Item_Name_PMM_AfterUpdate()
Me.SecondField = Left(Me.Item_Name_PMM, 32)
End Sub
 
Top