Hey all;

I'm using an Access 2000 Project w a SQL backend. I've got one form open (clients) and use a value on it to open another form (undo records). I want to open the undo records form filtered to only show undo records for the client record that was open on the previous form. Pretty easy no? Well, I've tried this 50 million ways, and can't seem to get it to work properly.

I've tried passing the server filter string as an opening argument, and then using that in the open event to set the server filter. Even w "me.serverfilter = "" on the closing event, this will always show the previous passed string. So, I run for Client 123, 124, and 125, and it'll open null, 123, and 124. Fun huh...

So, I've tried a bunch of other things. Everything from setting the normal filter, turning off the filterbyform, and now I'm using the docmd.applyfilter , "clientCode = 123" command. But NOW, it'll sometimes apply the filter to the calling form. As a final act of desperation, I put the apply filter into the GotFocus event, but now, the onclose generates an error when I try to remove the "Filter" property.

Anybody got any ideas? I'm putting the code I use in the Undo Client form below.



Private Sub Form_Close()
Me.ServerFilter = ""
Me.Filter = ""
Me.OrderBy = ""
Me.ServerFilterByForm = False
End Sub

Private Sub Form_Open(Cancel As Integer)
'Force default filter of ordering by update date, with the newest displayed on
' top.

'Remove Existing Filters
Me.ServerFilterByForm = False
Me.ServerFilter = ""
Me.Filter = ""
Me.FilterOn = False

'Set Ordering
Me.OrderBy = "zstblUndoCases.UpdateDate DESC"

'Set the server filter to the opening arguments, if any
If Len(Me.OpenArgs) > 0 Then DoCmd.ApplyFilter , me.OpenArgs

End Sub