Refresh doesn't work

Acke

Registered User.
Local time
Today, 20:39
Joined
Jul 1, 2006
Messages
158
I just swithed from Office 2003 to Office 2010 and my forms work funny now. Every time I want to update record on a form, based on control selection, I have to hit refresh button. I know I could solve problem with me.refresh, but I have a lot of places to put that command.

Why is this happening? Why does 2010 works different to 2003 Access?

How can I fix this, without having to go trough all codes?

Tks...
 
Could you explain this further?
Every time I want to update record on a form, based on control selection...
My old brain does not seem to understand what you are doing.
 
For example, I have a List box containing dates of data input. When I choose a date, form diplays all inputs from that date.

ListBox_AfterUpdate()

Me![textBox1] = Me!ListBox
Me.Filter = "Date = Forms![Form_Name]![textBox1]"
Me.FilterOn = True

Code was working for years and it still works. Only now, when I swithed to 2010 from 2003, I need to hit refresh every time I choose new date. Actually, the first time after form is loaded, I do not have to hit refresh, but any next time, I have to.

I suppose it must be solvable with some general settings option.

I hope this clarifies. In case not, I am happy to explain more.
 
Hmm...interesting. I would expect just changing the Filter would force a refresh of the form (as you did). Was the Filter ON *before* you issued the Me.FilterOn = True? What OS are you using?
 
Unfortunately, advices from provided link do not help.

My OS is Win7 starter. Office is 2010 starter. Access is 2010 full retail version.
 
Code:
ListBox_AfterUpdate()

Me![textBox1] = Me!ListBox
Me.Filter = "[B][[/B]Date[B]][/B] = Forms![Form_Name]![textBox1]"
Me.FilterOn = True

Date is a reserved word so try an enclose it in brackets. Mayby Access 2007/2010 is more sensitive about reserved words than earlier version.

also

Form_Name is a peculiar name for a form?

JR
 
Date is a reserved word so try an enclose it in brackets. Mayby Access 2007/2010 is more sensitive about reserved words than earlier version.

It is not actual name of table row. I just used that name to describe the code.

Form_Name is a peculiar name for a form?

Form also has apropriate name. Just thought it would be easier to understand the code, without using actual names of forms, controls...
 
Does that mean that it is working now??

JR
 
Yes it is working now and it was working for 10 years. Only problem is in having to hit refresh button every time I want to apply filter. When filter is applied first time, after form load, everything works fine. Any next time I want to filter data, I have to hit refresh.
 
Try it like this:
Code:
Me.Filter = vbNullString
Me.Filter = "[Date] = #" & Me.
[ListBox] & "#"
Me.FilterOn = True
 
This way it does not work at all. I receive no data at all, after filter apply.

Thing is that I have number of forms using similar code. They all are not working. I sencerely hope there is more elegant solution then fixing code by code.

I tried me.refresh and it is not working as well. Then I realized that I am not hiting "refresh", but "refresh all" button.

How can that be explained? How is it possible that same code works in number of different forms in Access 2003 while not in Access 2010?
 
Remove the "#" on the second line and give it a go again, i.e. the second line should be

Me.Filter = "[Date] = " & Me.
[ListBox]
 
If I add me.requery at the end of original code, then everything works.
 
Yes, I did. But, I already have solution to add me.requery to the end of each code. That would solve the problem. Only, I would prefer to find general solution that would be aplicable to all problematic codes. And there is a lot of these codes.

It looks as if Access 2003 was requering automaticaly, after my filter code was implemented, while Access 2010 does not.

What I want to say is that I already have fix-code-by-code solution. What I am after is how to make Access 2010 work as Access 2003, for the case of above-mentioned filter.
 
What I want to say is that I already have fix-code-by-code solution. What I am after is how to make Access 2010 work as Access 2003, for the case of above-mentioned filter.
This is what we're pursuing.

One final try:
Code:
Me.FilterOn = False
Me.Filter = vbNullString
Me.Filter = "[Date] = " & Me.
[ListBox]
Me.FilterOn = True
 
Still the same. Your code behaves the same dispite any change we made.

One final try:

I hope it is not final try. I realy would not like to see myself fixing a lot of codes.
 

Users who are viewing this thread

Back
Top Bottom