Link to home
Start Free TrialLog in
Avatar of ChrisThornton
ChrisThorntonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Server Filter By Form Disables All Fields

I have an Access Project connected to a SQL Server 2000 backend. I have two development machines (one at home and one at my client site) that I use to maintain the project - one has Access XP and the other Access 2003. I have a form that has the "Server Filter By Form" property set to True so it opens up in the filter mode. This works fine on the Office XP machine, but on the 2003 machine when the filter form opens all the fields are disabled, so no filter can be applied. It is essential for it to open in the filter mode to allow the user to restrict the records they retrieve as they may be connecting from a remote site. Any ideas?
Avatar of arcross
arcross
Flag of United Kingdom of Great Britain and Northern Ireland image

When that form opens in 2003 has a recordsource associate to it? maybe for any reason that recordsoruce has gone, i say this cause the only thing i cant think now is that the controls are unbound. Just a thought

Álvaro
Avatar of ChrisThornton

ASKER

As soon as I press the "Apply Filter" button all the records show, so I guess the connection and the recordset are OK. I have tried setting the .enabled property of the controls manually in the Form_Filter event. They show as Enabled in the event, but as soon as I step out of the event they are reset back to false.
When you do a filter the forms keeps the last filter string on it, could it be that when you apply the filter as soon the form opens has a field with sometging on it? If you do me.filter = "" it woud clean it.

Well, but i wouldnt let them disable Hmmm
Nothing in there I'm afraid. Tried setting me.filter = "" but no luck.
if the OPEN event instead of your "server filter..." you do: (remove the property you have set to TRUE)

DoCmd.RunCommand acCmdFilterByForm

What does it come with?

Tried this, but it applies a client-side filter. I need to use a server filter to avoid the unnecessary records being sent to the client over the WAN. So I tried

DoCmd.RunCommand acCmdServerFilterByForm

but I get Error 2046 - The command or action 'ServerFilterByForm' isn't available now.
ASKER CERTIFIED SOLUTION
Avatar of arcross
arcross
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Álvaro.

There was I thinking you could just set a property in design mode - when in fact you have to set it in code, twice!

Chris.
Hey Chris well done!

Glad it did work !