dbTalk Databases Forums  

How to work with the command "Refresh"

comp.databases.ms-access comp.databases.ms-access


Discuss How to work with the command "Refresh" in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simon
 
Posts: n/a

Default How to work with the command "Refresh" - 03-08-2008 , 07:50 AM






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.WorkLoad_No01) Then

Me.WorkLoad_No01.Value = "*"

Me.WorkLoad_No01.BackColor = 65535 'Yellow

Me.WorkLoad_Hrs = Me.WorkLoad_Hrs + 40

Else

Me.WorkLoad_No01.Value = Null

Me.WorkLoad_No01.BackColor = -2147483643 'Blank

Me.WorkLoad_Hrs = Me.WorkLoad_Hrs - 40

End If



Me.Refresh

Forms.F102m_Workload.Refresh

Forms.F101m_Workload.Refresh



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

Tanks for any help.

Kind regards,

Simon




Reply With Quote
  #2  
Old   
Linq Adams via AccessMonster.com
 
Posts: n/a

Default Re: How to work with the command "Refresh" - 03-08-2008 , 08:27 AM






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.com
http://www.accessmonster.com/Uwe/For...ccess/200803/1


Reply With Quote
  #3  
Old   
Neil
 
Posts: n/a

Default Re: How to work with the command "Refresh" - 03-08-2008 , 10:49 AM



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 (AT) Versatel (DOT) nl> wrote

Quote:
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.WorkLoad_No01) Then

Me.WorkLoad_No01.Value = "*"

Me.WorkLoad_No01.BackColor = 65535 'Yellow

Me.WorkLoad_Hrs = Me.WorkLoad_Hrs + 40

Else

Me.WorkLoad_No01.Value = Null

Me.WorkLoad_No01.BackColor = -2147483643 'Blank

Me.WorkLoad_Hrs = Me.WorkLoad_Hrs - 40

End If



Me.Refresh

Forms.F102m_Workload.Refresh

Forms.F101m_Workload.Refresh



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

Tanks for any help.

Kind regards,

Simon






Reply With Quote
  #4  
Old   
Simon
 
Posts: n/a

Default Re: How to work with the command "Refresh" - 03-08-2008 , 02:42 PM



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.SumFieldB.
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.com" <u28780@uwe> schreef in bericht
news:80da2b51e71b8 (AT) uwe (DOT) ..
Quote:
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.com

http://www.accessmonster.com/Uwe/For...ccess/200803/1





Reply With Quote
  #5  
Old   
DawnTreader
 
Posts: n/a

Default Re: How to work with the command "Refresh" - 03-09-2008 , 11:01 AM



On Mar 8, 1:42*pm, "Simon" <SvanBee... (AT) Versatel (DOT) nl> wrote:
Quote:
* 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.SumFieldB.
* 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.com" <u28780@uwe> schreef in berichtnews:80da2b51e71b8 (AT) uwe (DOT) ..
* > 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.com
* >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 txtboxmytypeinfield_lost_focus()
forms!forma.form.txtthecontroltorequery.requery
end sub

or something like that.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.