469,645 Members | 1,571 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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.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

Mar 8 '08 #1
4 2311
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

Mar 8 '08 #2
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" <Sv********@Versatel.nlwrote in message
news:47**********************@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.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

Mar 8 '08 #3
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@uweschreef in bericht
news:80da2b51e71b8@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.com
http://www.accessmonster.com/Uwe/For...ccess/200803/1
>


Mar 8 '08 #4
On Mar 8, 1:42*pm, "Simon" <SvanBee...@Versatel.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.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@uweschreef in berichtnews:80da2b51e71b8@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.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.
Mar 9 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chumley Walrus | last post: by
3 posts views Thread by George Durzi | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.