Microsoft KB Archive/172090
Article ID: 172090
Article Last Modified on 1/20/2007
- Microsoft Office 97 Developer Edition
- Microsoft Access 97 Standard Edition
This article was previously published under Q172090
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you try to open a form in Filter-by-Form view programmatically in a Microsoft Access 97 run-time application, you may receive the following error message
The Filter-by-Form commands are unavailable in a Microsoft Access 97 run-time application.
For more information about simulating Filter-by-Form in a run-time application, please see the following article in the Microsoft Knowledge Base:
166634 ACC97: Filter-by-Form Example for Run-Time Apps Available in Download Center
In Microsoft Access 7.0, Filter-by-Form works in both the full version and the run-time version. However, the Filter-by-Form functionality wasn't designed to be available in a Microsoft Access 7.0 run-time application.
Steps to Reproduce Behavior
CAUTION: Following these steps will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.
- Open the sample database Northwind.mdb, and open the Customers form in Design view.
- Add a command button to the form.
- Change the Name property for the command button to btnFilter.
Place the following code in the OnClick event procedure of the command button:
Private Sub btnFilter_Click() DoCmd.RunCommand acCmdFilterByForm End Sub
- Close and save the form.
- On the Tools menu, click Startup.
- Under Display Form, select Customers from the list, and then click OK.
On the Start menu, click Run, and then type the following command.
NOTE: In the following sample, an underscore (_) at the end of a line is used as a line-continuation character. Remove the underscore from the end of the line when typing this command.
NOTE: In the following sample, replace C:\Program Files\Microsoft Office\Office\ with the path to where Msaccess.exe is located on your hard drive.
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" _ "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" _ /Runtime
- When the Customers form opens, click the button that you created in step 2.
Note that the filter-by-form view does not come up, and you receive the errors listed in the "Symptoms" section.
Additional query words: ODE Raid Sweep run time error 2501
Keywords: kberrmsg kbhowto kbprb kbusage KB172090