Repeat value of previous record field into current corresponding field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roveagh1
    New Member
    • Apr 2007
    • 1

    Repeat value of previous record field into current corresponding field

    Hi
    I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same logic for a date field. i.e.

    theValue.defaul tvalue = "#" & theValue.value & "#"

    I can't get this to work for some reason and I can't figure out why. Can anyone out there help?

    Thanks

    Repeat value of previous record field into current corresponging field
    --------------------------------------------------------------------------------

    Something really common I'm sure and I'm surprised it's not just a field
    property option.

    The previous record's field value can be retrieved and copied into the
    current corresponding field by the operator hitting CTRL+APOSTROPHE on the
    new field but I would like this to occur with the user having to strike any
    keys.

    Suggestions?

    Thanks,

    Loren




    --------------------------------------------------------------------------------

    Report
    Bas Cost Budde
    Guest
    n/a Posts November 13th, 2005
    06:07 AM
    #2


    Re: Repeat value of previous record field into current corresponging field
    --------------------------------------------------------------------------------

    lorendi@interne t.com wrote:[color=blue]
    > Something really common I'm sure and I'm surprised it's not just a field
    > property option.
    >
    > The previous record's field value can be retrieved and copied into the
    > current corresponding field by the operator hitting CTRL+APOSTROPHE on the
    > new field but I would like this to occur with the user having to strike any
    > keys.[/color]

    It *is* a field property.

    In the AfterUpdate event of the control (let's say it is called
    theValue), put

    theValue.defaul tvalue = theValue.value

    If theValue is text, do this:

    theValue.defaul tvalue = "'" & theValue.value & "'"

    --
    Bas Cost Budde, Holland
    http://www.heuveltop.n l/BasCB/msac_index.html
    I prefer human mail above automated so in my address
    replace the queue with a tea


    --------------------------------------------------------------------------------

    Report
    Guest
    n/a Posts November 13th, 2005
    06:09 AM
    #3


    Re: Repeat value of previous record field into current corresponging field
    --------------------------------------------------------------------------------

    On Mon, 06 Dec 2004 08:11:42 +0100, Bas Cost Budde
    <b.costbudde@he uvelqop.nl> wrote:
    [color=blue]
    >lorendi@intern et.com wrote:[color=green]
    >> Something really common I'm sure and I'm surprised it's not just a field
    >> property option.
    >>
    >> The previous record's field value can be retrieved and copied into the
    >> current corresponding field by the operator hitting CTRL+APOSTROPHE onthe
    >> new field but I would like this to occur with the user having to strike any
    >> keys.[/color]
    >
    >It *is* a field property.
    >
    >In the AfterUpdate event of the control (let's say it is called
    >theValue), put
    >
    > theValue.defaul tvalue = theValue.value
    >
    >If theValue is text, do this:
    >
    > theValue.defaul tvalue = "'" & theValue.value & "'"[/color]

    Ah yes, that did it!

    Thank You very much.

    LB


    --------------------------------------------------------------------------------

    Report
    Guest
    n/a Posts November 13th, 2005
    06:59 AM
    #4


    Re: Repeat value of previous record field into current corresponging field
    --------------------------------------------------------------------------------

    On Mon, 06 Dec 2004 16:36:24 -0600, <lorendi@intern et.com> wrote:
    [color=blue]
    >On Mon, 06 Dec 2004 08:11:42 +0100, Bas Cost Budde
    ><b.costbudde@h euvelqop.nl> wrote:
    >[color=green]
    >>lorendi@inter net.com wrote:[color=darkred]
    >>> Something really common I'm sure and I'm surprised it's not just a field
    >>> property option.
    >>>
    >>> The previous record's field value can be retrieved and copied into the
    >>> current corresponding field by the operator hitting CTRL+APOSTROPHE on the
    >>> new field but I would like this to occur with the user having to strike any
    >>> keys.[/color]
    >>
    >>It *is* a field property.
    >>
    >>In the AfterUpdate event of the control (let's say it is called
    >>theValue), put
    >>
    >> theValue.defaul tvalue = theValue.value
    >>
    >>If theValue is text, do this:
    >>
    >> theValue.defaul tvalue = "'" & theValue.value & "'"[/color]
    >
    >Ah yes, that did it!
    >
    >Thank You very much.
    >
    >LB[/color]

    The above event/code worked fine for a text type control but not for a date
    type. Can someone please tell me what to use to propagate a date field?

    Thanks.


    --------------------------------------------------------------------------------

    Report
    jv
    Guest
    n/a Posts November 13th, 2005
    07:00 AM
    #5


    Re: Repeat value of previous record field into current corresponging field
    --------------------------------------------------------------------------------

    same concept, except with # signs
    theValue.defaul tvalue = "#" & theValue.value & "#"
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    This questions is being moved to the Visual Basic forum.

    ADMIN

    Comment

    Working...