By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,948 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,948 IT Pros & Developers. It's quick & easy.

Trying to repaint a form with a new filter

P: n/a
Bob
Trying to repaint a form named fcon using a new filter:

'Repaint the form with the new data
Forms!fcon.FilterOn = False
Forms!fcon.Filter = "RecNo = " & currecno & " AND Currentvalue = -1"
Forms!fcon.FilterOn = True
Forms!fcon.Requery

Stop

DoCmd.Minimize

DoCmd.Restore
Stop
Me.Repaint
Stop
the immediately preceding code changes the source for the form, a
query. It appears that the filter statement and values are correct.
However the form never repaints.
Suggestions?

Bob
bobalston9 at AOL dot com

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Maybe try I think:
DoCmd.RunCommand acCmdRefresh

The last couple weeks though, my experience is that filters in access
are querky. I'm going to try to figure out how to generate queries
dynamically instead.

Nov 13 '05 #2

P: n/a
Bob
Will try that. One thing I found is that it works correctly if I do
not use the auto start of the startup form. If I startup the same
form, it works.

Go figure!

Bob

Nov 13 '05 #3

P: n/a
Bob
DoCmd.RunCommand acCmdRefresh

did not help.
But it did point out that apparently there is a subform. so maybe it
needs a record source refreshed.

Bob

Nov 13 '05 #4

P: n/a
Bob
I have a workaround. If I open the database but leave the database
window visible it works fine. If I change that one startup parm, it
fails.

I would guess it is due to the record source of the subforms and likely
the need to requery them.

Go figure.

Bob

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.