Filtered form takes longer to close.

I

I'm a Trampoline

Does anyone know why this is? I'm opening it with the Where argument set
on the DoCmd.OpenForm, and if I don't filter the form it closes fast. If
I do filter it (using the Filter property, then setting FilterOn to
True) it takes longer to close. Even if I program it to take the filter
off before closing (which it didn't appear to do).

I tried the whole deal a different way, by setting the forms
RecordSource property on opening with a SQL string. Then changed the SQL
for the RecordSource property with my filter function, instead of using
the filter property. And then set the recordsource to nothing before
closing. This closes slowly all of the time.

It's not something to do with indexing is it? I'm not changing any
records though.

Thanks in advance.
 
A

Allen Browne

Two things to try:

1. Uncheck the Name AutoCorrect boxes under:
Tools | Options | General.

2. Try putting a command button on the form to close it, and put this code
into its Click event procedure:

Private Sub cmdClose_Click()
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

If the first one solve it, see:
http://members.iinet.net.au/~allenbrowne/bug-03.html

If the second one solve it, the problem relates to the way Access is saving
the Filter property when you close the form.

BTW, "I'm a Trampoline" because your email bounces?
 
I

I'm a Trampoline

Allen said:
Two things to try:

1. Uncheck the Name AutoCorrect boxes under:
Tools | Options | General.

2. Try putting a command button on the form to close it, and put this code
into its Click event procedure:

Private Sub cmdClose_Click()
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

If the first one solve it, see:
http://members.iinet.net.au/~allenbrowne/bug-03.html

If the second one solve it, the problem relates to the way Access is saving
the Filter property when you close the form.

BTW, "I'm a Trampoline" because your email bounces?

Thanks for that, I'll try it on Monday at work (I'm in NZ so it's Friday
night as well). I'm a Trampoline is a lyric from one of my favourite
songs (Carbon Scoring by Jimmy Eat World). That interpretation makes it
kind of cute for an address.
 
I

I'm a Trampoline

Allen said:
Two things to try:

1. Uncheck the Name AutoCorrect boxes under:
Tools | Options | General.

2. Try putting a command button on the form to close it, and put this code
into its Click event procedure:

Private Sub cmdClose_Click()
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

If the first one solve it, see:
http://members.iinet.net.au/~allenbrowne/bug-03.html

If the second one solve it, the problem relates to the way Access is saving
the Filter property when you close the form.

It was the 2nd, is there any way around it that doesn't involve having
the disable the standard close button and make a custom one? Changing
the sort order also has the same effect, I think it's any form property
that'll produce the delay.
 
Top