Appy a Filter when opening a table from a Form

Anhjan

New member
Local time
Yesterday, 21:13
Joined
Jun 26, 2002
Messages
9
I'm new to VBA...here's what I'm trying to do.

I have a main form which is the user interface and would like to create a button that will open a table and apply a filter to that table.

Here's what I got...

Private Sub OpenPFTable_Click()
On Error GoTo Err_OpenPFTable_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "tbl Problem Freight"
DoCmd.OpenTable stDocName, acViewNormal


Exit_OpenPFTable_Click:
Exit Sub

Err_OpenPFTable_Click:
MsgBox Err.Description
Resume Exit_OpenPFTable_Click

End Sub

How would I appy a filter in the code???

Thanks,
Jan
 
I am pretty sure that you can't apply a filter to a table. There is no reason to do this as a table was not designed to be used to view or manipulate data. It is strictly for holding data. If you want to display data without updating it, use a query. If you want to display data and be able to update it, use a datasheet style form.

HTH
Chris
 

Users who are viewing this thread

Back
Top Bottom