Re: Setting .DefaultValue causes Restart
From: Larry Jones (lljo40_at_netscape.net)
Date: 07/06/04
- Next message: Bill Brinkworth: "Formatting Memo text"
- Previous message: Larry Daugherty: "Re: Automatic record saving"
- In reply to: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Next in thread: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Reply: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Messages sorted by: [ date ] [ thread ]
Date: 6 Jul 2004 08:04:08 -0700
In the Default property for this textbox, I put the following:
=Nz(DMax("Order", "tblPersonnelLocation", "PersonnelID = " &
Me.Parent.PersonnelID), 0) + 1
BUT, Access changes it to
Nz(DMax("Order","tblPersonnelLocation","PersonnelID = " &
[Me].[Parent].[PersonnelID]),0)+1
This change does not work (even in immediate mode) while the syntax I
used does work (in immediate mode and in code anyway). The way Access
changes it, gives me a ?#NAme error
I have to get PersonnelID from the parent form, because when a new
location record is being created for the person on this subform, there
is no PersonnelID on the new record, so I can't refer to it.
So I change the referenc to refer to the name of the parent form and
that seems to work. BUT when I delete a location, I now get an error
that says "can't find the field '|' referred to in your expression".
argh!
It goes ahead and deletes the record, but then increments the counter
on the next "blank" record. So frustrating!
Steve Schapel <schapel@mvps.org.ns> wrote in message news:<ukoifRGYEHA.3664@TK2MSFTNGP12.phx.gbl>...
> Larry,
>
> This is standard procedure, and so if it "does not work properly", there
> must be a reason. What does "does not work properly" mean? And what is
> the exact expression you used in the Default Value property setting?
- Next message: Bill Brinkworth: "Formatting Memo text"
- Previous message: Larry Daugherty: "Re: Automatic record saving"
- In reply to: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Next in thread: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Reply: Steve Schapel: "Re: Setting .DefaultValue causes Restart"
- Messages sorted by: [ date ] [ thread ]