How to work with the command "Refresh"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    #1

    How to work with the command "Refresh"

    Dear reader,



    If I change the content of a field in an event procedure and in the same
    procedure I do a refresh, the refresh has no effect. The code in the event
    is as follows:



    If IsNull(Me.WorkL oad_No01) Then

    Me.WorkLoad_No0 1.Value = "*"

    Me.WorkLoad_No0 1.BackColor = 65535 'Yellow

    Me.WorkLoad_Hrs = Me.WorkLoad_Hrs + 40

    Else

    Me.WorkLoad_No0 1.Value = Null

    Me.WorkLoad_No0 1.BackColor = -2147483643 'Blank

    Me.WorkLoad_Hrs = Me.WorkLoad_Hrs - 40

    End If



    Me.Refresh

    Forms.F102m_Wor kload.Refresh

    Forms.F101m_Wor kload.Refresh



    How to handle the refresh to have effect on the changes I made.

    Tanks for any help.

    Kind regards,

    Simon



  • Linq Adams via AccessMonster.com

    #2
    Re: How to work with the command "Refresh&q uot;

    What exactly are you expecting Refresh to do? What do you mean when you say
    "the refresh has no effect?" Refresh is intended to be used in multi-user
    apps so that if User A makes a change on Joe Blow's record, User B can
    Refresh and see the change. It does not save changes to the underlying table
    nor do a Requery.

    --
    There's ALWAYS more than one way to skin a cat!

    Answers/posts based on Access 2000/2003

    Message posted via AccessMonster.c om


    Comment

    • Neil

      #3
      Re: How to work with the command "Refresh&q uot;

      Refresh is used to get the latest data from the underlying table. If you're
      updating the record yourself, then you shouldn't need Refresh at all.

      It's possible that your Refresh below is actually removing your (unsaved)
      changes by replacing them with what's stored in the table. Try taking out
      the Refresh and see what happens.



      "Simon" <SvanBeekNL@Ver satel.nlwrote in message
      news:47d299bc$0 $6881$bf4948fe@ news.tele2.nl.. .
      Dear reader,
      >
      >
      >
      If I change the content of a field in an event procedure and in the same
      procedure I do a refresh, the refresh has no effect. The code in the event
      is as follows:
      >
      >
      >
      If IsNull(Me.WorkL oad_No01) Then
      >
      Me.WorkLoad_No0 1.Value = "*"
      >
      Me.WorkLoad_No0 1.BackColor = 65535 'Yellow
      >
      Me.WorkLoad_Hrs = Me.WorkLoad_Hrs + 40
      >
      Else
      >
      Me.WorkLoad_No0 1.Value = Null
      >
      Me.WorkLoad_No0 1.BackColor = -2147483643 'Blank
      >
      Me.WorkLoad_Hrs = Me.WorkLoad_Hrs - 40
      >
      End If
      >
      >
      >
      Me.Refresh
      >
      Forms.F102m_Wor kload.Refresh
      >
      Forms.F101m_Wor kload.Refresh
      >
      >
      >
      How to handle the refresh to have effect on the changes I made.
      >
      Tanks for any help.
      >
      Kind regards,
      >
      Simon
      >
      >
      >

      Comment

      • Simon

        #4
        Re: How to work with the command &quot;Refresh&q uot;

        I have two forms; FormA and FormB. Both forms are open.
        In FormA there is a field FielA and the control source is:
        =Forms.FormB.Su mFieldB.
        In FormB there is a field with the name SumFielB and the control source
        is:
        =Sum(FieldB)
        By a change in FielB the SumFieldB is changed as well but the content of
        FieldA in FormA is not changed. How to synchronise FieldA in FormA as the
        FieldB in FormB is changed.

        Tanks for any sugestion



        "Linq Adams via AccessMonster.c om" <u28780@uweschr eef in bericht
        news:80da2b51e7 1b8@uwe...
        What exactly are you expecting Refresh to do? What do you mean when you
        say
        "the refresh has no effect?" Refresh is intended to be used in
        multi-user
        apps so that if User A makes a change on Joe Blow's record, User B can
        Refresh and see the change. It does not save changes to the underlying
        table
        nor do a Requery.
        >
        --
        There's ALWAYS more than one way to skin a cat!
        >
        Answers/posts based on Access 2000/2003
        >
        Message posted via AccessMonster.c om
        >
        http://www.accessmonster.com/Uwe/For...ccess/200803/1
        >


        Comment

        • DawnTreader

          #5
          Re: How to work with the command &quot;Refresh&q uot;

          On Mar 8, 1:42 pm, "Simon" <SvanBee...@Ver satel.nlwrote:
            I have two forms; FormA and FormB. Both forms are open.
            In FormA there is a field FielA and the control source is:
            =Forms.FormB.Su mFieldB.
            In FormB there is a field with the name SumFielB and the control source
          is:
            =Sum(FieldB)
            By a change in FielB the SumFieldB is changed as well but the content of
          FieldA in FormA is not changed. How to synchronise FieldA in FormA as the
          FieldB in FormB is changed.
          >
            Tanks for any sugestion
          >
            "Linq Adams via AccessMonster.c om" <u28780@uweschr eef in berichtnews:80d a2b51e71b8@uwe. ..
            What exactly are you expecting Refresh to do? What do you mean when you
          say
            "the refresh has no effect?" Refresh is intended to be used in
          multi-user
            apps so that if User A makes a change on Joe Blow's record, User B can
            Refresh and see the change. It does not save changes to the underlying
          table
            nor do a Requery.
            >
            --
            There's ALWAYS more than one way to skin a cat!
            >
            Answers/posts based on Access 2000/2003
            >
            Message posted via AccessMonster.c om
            >http://www.accessmonster.com/Uwe/For...ms-access/2008....
            >
          Requery the control instead of refreshing. you will need something to
          cause the refresh to happen. usually when i am doing this i use the
          lost focus on the control that i have just put input on and tell it to
          cause the other control to requery.

          private sub txtboxmytypeinf ield_lost_focus ()
          forms!forma.for m.txtthecontrol torequery.reque ry
          end sub

          or something like that.

          Comment

          Working...