Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Re: On carrying the current value of a control forward...

Discussion in 'Information Technology' started by Ricter, Jul 28, 2006.

  1. Ricter

    Ricter
    Expand Collapse
    Guest

    Jeff, I can't get this to work. I also tried using Me!, and I tried using
    Before_Update...



    "Jeff Boyce" wrote:

    > Ricter
    >
    > In the control's AfterUpdate event, add code that sets that control's
    > DefaultValue to the control's value. It might look something like:
    >
    > Me.YourControl.DefaultValue = Me.YourControl
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Office/Access MVP
    >
    > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > news:2C3FC7B4-2246-4991-A5E6-B7A63C6E4038@microsoft.com...
    > > The example code for this on the Access Web is not quite what I was hoping
    > > for.
    > >
    > > When I enter a new record, I'd like the last value of that control to
    > > carry
    > > forward, and if the user decides to type over it, I'd like THAT entry to
    > > become the next and subsequent records' default value, until it is changed
    > > again.
    > >
    > > Can this be done On Enter or some other event, instead of being attached
    > > to
    > > a button or other extra control as in Dev Ashish's example ?
    > >
    > > tia
    > >

    >
    >
    >
     
  2. Loading...


  3. Jeff Boyce

    Jeff Boyce
    Expand Collapse
    Guest

    Ricter

    I don't know what to tell you... it works when I do it.

    Perhaps if you posted the code you're using...?

    Regards

    Jeff Boyce
    Microsoft Office/Access MVP

    "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    news:95C5C69D-C4E4-427E-975D-6D909F399F48@microsoft.com...
    > Jeff, I can't get this to work. I also tried using Me!, and I tried using
    > Before_Update...
    >
    >
    >
    > "Jeff Boyce" wrote:
    >
    >> Ricter
    >>
    >> In the control's AfterUpdate event, add code that sets that control's
    >> DefaultValue to the control's value. It might look something like:
    >>
    >> Me.YourControl.DefaultValue = Me.YourControl
    >>
    >> Regards
    >>
    >> Jeff Boyce
    >> Microsoft Office/Access MVP
    >>
    >> "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    >> news:2C3FC7B4-2246-4991-A5E6-B7A63C6E4038@microsoft.com...
    >> > The example code for this on the Access Web is not quite what I was
    >> > hoping
    >> > for.
    >> >
    >> > When I enter a new record, I'd like the last value of that control to
    >> > carry
    >> > forward, and if the user decides to type over it, I'd like THAT entry
    >> > to
    >> > become the next and subsequent records' default value, until it is
    >> > changed
    >> > again.
    >> >
    >> > Can this be done On Enter or some other event, instead of being
    >> > attached
    >> > to
    >> > a button or other extra control as in Dev Ashish's example ?
    >> >
    >> > tia
    >> >

    >>
    >>
    >>
     
  4. Ricter

    Ricter
    Expand Collapse
    Guest

    Jeff, I got the following to work:

    Private Sub Control_Exit(Cancel As Integer)
    Const cQuote = """" 'Thats two quotes
    Me!Control.DefaultValue = cQuote & Me!Control.Value & cQuote
    End Sub

    As you can see, all I did was use Dev Ashish's code, but put it in the Exit
    event instead of attaching it to a button. I never did get
    Me.Broker.DefaultValue=Me.Broker to work in any configuration or location.



    "Jeff Boyce" wrote:

    > Ricter
    >
    > I don't know what to tell you... it works when I do it.
    >
    > Perhaps if you posted the code you're using...?
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Office/Access MVP
    >
    > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > news:95C5C69D-C4E4-427E-975D-6D909F399F48@microsoft.com...
    > > Jeff, I can't get this to work. I also tried using Me!, and I tried using
    > > Before_Update...
    > >
    > >
    > >
    > > "Jeff Boyce" wrote:
    > >
    > >> Ricter
    > >>
    > >> In the control's AfterUpdate event, add code that sets that control's
    > >> DefaultValue to the control's value. It might look something like:
    > >>
    > >> Me.YourControl.DefaultValue = Me.YourControl
    > >>
    > >> Regards
    > >>
    > >> Jeff Boyce
    > >> Microsoft Office/Access MVP
    > >>
    > >> "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > >> news:2C3FC7B4-2246-4991-A5E6-B7A63C6E4038@microsoft.com...
    > >> > The example code for this on the Access Web is not quite what I was
    > >> > hoping
    > >> > for.
    > >> >
    > >> > When I enter a new record, I'd like the last value of that control to
    > >> > carry
    > >> > forward, and if the user decides to type over it, I'd like THAT entry
    > >> > to
    > >> > become the next and subsequent records' default value, until it is
    > >> > changed
    > >> > again.
    > >> >
    > >> > Can this be done On Enter or some other event, instead of being
    > >> > attached
    > >> > to
    > >> > a button or other extra control as in Dev Ashish's example ?
    > >> >
    > >> > tia
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    You need

    Me.Broker.DefaultValue=cQuote & Me.Broker & cQuote

    or

    Me.Broker.DefaultValue=Chr$(34) & Me.Broker & Chr$(34)

    (even if the value is numeric)

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    news:091C67DF-833E-444C-8549-78C9B3771E86@microsoft.com...
    > Jeff, I got the following to work:
    >
    > Private Sub Control_Exit(Cancel As Integer)
    > Const cQuote = """" 'Thats two quotes
    > Me!Control.DefaultValue = cQuote & Me!Control.Value & cQuote
    > End Sub
    >
    > As you can see, all I did was use Dev Ashish's code, but put it in the

    Exit
    > event instead of attaching it to a button. I never did get
    > Me.Broker.DefaultValue=Me.Broker to work in any configuration or location.
    >
    >
    >
    > "Jeff Boyce" wrote:
    >
    > > Ricter
    > >
    > > I don't know what to tell you... it works when I do it.
    > >
    > > Perhaps if you posted the code you're using...?
    > >
    > > Regards
    > >
    > > Jeff Boyce
    > > Microsoft Office/Access MVP
    > >
    > > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > > news:95C5C69D-C4E4-427E-975D-6D909F399F48@microsoft.com...
    > > > Jeff, I can't get this to work. I also tried using Me!, and I tried

    using
    > > > Before_Update...
    > > >
    > > >
    > > >
    > > > "Jeff Boyce" wrote:
    > > >
    > > >> Ricter
    > > >>
    > > >> In the control's AfterUpdate event, add code that sets that control's
    > > >> DefaultValue to the control's value. It might look something like:
    > > >>
    > > >> Me.YourControl.DefaultValue = Me.YourControl
    > > >>
    > > >> Regards
    > > >>
    > > >> Jeff Boyce
    > > >> Microsoft Office/Access MVP
    > > >>
    > > >> "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > > >> news:2C3FC7B4-2246-4991-A5E6-B7A63C6E4038@microsoft.com...
    > > >> > The example code for this on the Access Web is not quite what I was
    > > >> > hoping
    > > >> > for.
    > > >> >
    > > >> > When I enter a new record, I'd like the last value of that control

    to
    > > >> > carry
    > > >> > forward, and if the user decides to type over it, I'd like THAT

    entry
    > > >> > to
    > > >> > become the next and subsequent records' default value, until it is
    > > >> > changed
    > > >> > again.
    > > >> >
    > > >> > Can this be done On Enter or some other event, instead of being
    > > >> > attached
    > > >> > to
    > > >> > a button or other extra control as in Dev Ashish's example ?
    > > >> >
    > > >> > tia
    > > >> >
    > > >>
    > > >>
    > > >>

    > >
    > >
    > >
     
  6. Ricter

    Ricter
    Expand Collapse
    Guest

    Douglas, the first option, using only cQuote, does not work for me (unless I
    define it as Ashish did), but Chr$(34) does. *shrug*

    I also figured out that I don't need to define cQuote, as Dev Ashish does,
    but can use Me.Control.DefaultValue = """" & Me. Control.Value & """".
    Inelegant perhaps.

    Thanks all!

    "Douglas J Steele" wrote:

    > You need
    >
    > Me.Broker.DefaultValue=cQuote & Me.Broker & cQuote
    >
    > or
    >
    > Me.Broker.DefaultValue=Chr$(34) & Me.Broker & Chr$(34)
    >
    > (even if the value is numeric)
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > news:091C67DF-833E-444C-8549-78C9B3771E86@microsoft.com...
    > > Jeff, I got the following to work:
    > >
    > > Private Sub Control_Exit(Cancel As Integer)
    > > Const cQuote = """" 'Thats two quotes
    > > Me!Control.DefaultValue = cQuote & Me!Control.Value & cQuote
    > > End Sub
    > >
    > > As you can see, all I did was use Dev Ashish's code, but put it in the

    > Exit
    > > event instead of attaching it to a button. I never did get
    > > Me.Broker.DefaultValue=Me.Broker to work in any configuration or location.
    > >
    > >
    > >
    > > "Jeff Boyce" wrote:
    > >
    > > > Ricter
    > > >
    > > > I don't know what to tell you... it works when I do it.
    > > >
    > > > Perhaps if you posted the code you're using...?
    > > >
    > > > Regards
    > > >
    > > > Jeff Boyce
    > > > Microsoft Office/Access MVP
    > > >
    > > > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > > > news:95C5C69D-C4E4-427E-975D-6D909F399F48@microsoft.com...
    > > > > Jeff, I can't get this to work. I also tried using Me!, and I tried

    > using
    > > > > Before_Update...
    > > > >
    > > > >
    > > > >
    > > > > "Jeff Boyce" wrote:
    > > > >
    > > > >> Ricter
    > > > >>
    > > > >> In the control's AfterUpdate event, add code that sets that control's
    > > > >> DefaultValue to the control's value. It might look something like:
    > > > >>
    > > > >> Me.YourControl.DefaultValue = Me.YourControl
    > > > >>
    > > > >> Regards
    > > > >>
    > > > >> Jeff Boyce
    > > > >> Microsoft Office/Access MVP
    > > > >>
    > > > >> "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > > > >> news:2C3FC7B4-2246-4991-A5E6-B7A63C6E4038@microsoft.com...
    > > > >> > The example code for this on the Access Web is not quite what I was
    > > > >> > hoping
    > > > >> > for.
    > > > >> >
    > > > >> > When I enter a new record, I'd like the last value of that control

    > to
    > > > >> > carry
    > > > >> > forward, and if the user decides to type over it, I'd like THAT

    > entry
    > > > >> > to
    > > > >> > become the next and subsequent records' default value, until it is
    > > > >> > changed
    > > > >> > again.
    > > > >> >
    > > > >> > Can this be done On Enter or some other event, instead of being
    > > > >> > attached
    > > > >> > to
    > > > >> > a button or other extra control as in Dev Ashish's example ?
    > > > >> >
    > > > >> > tia
    > > > >> >
    > > > >>
    > > > >>
    > > > >>
    > > >
    > > >
    > > >

    >
    >
    >
     

Share This Page