Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lin kcriteria or filter not working

Status
Not open for further replies.

belovedcej

Programmer
Nov 16, 2005
358
US
I have a form that is bound to a view.

When I open it from one screen I link on claim number. All works.

When I open it from another screen I want two links - on person_ID and when Collection_Events_B is true (or 1).

I have tried this as either a linked criterion or as a serverfilter (see below for my attempts). It never works! No blowups, it just ignores the true/false field all together. (The person-Id link has always worked fine.)

Could someone please advice me?


Code:
Dim intPersonID As Long
Dim stDocName As String
Dim stLinkCriteria As String

intPersonID = Me.person_ID
stDocName = "frmEvents"
stLinkCriteria = "[Person_ID] = " & intPersonID & "[Collection_Events_B] = 1"

'Form_frmEvents.Tag = "set filter"
'Form_frmEvents.ServerFilter = "[Collection_Events_B] <> 0"
DoCmd.OpenForm stDocName
'Form_frmEvents.ServerFilterByForm = True
 
Okay -I figured this out. I just had to requery the form for the filter to apply.

Now I can reuse the same forms and views repeatedly!!


This worked!!
Code:
Dim intPersonID As Long
Dim stDocName As String
Dim rst As New ADODB.Recordset

Dim stLinkCriteria As String

intPersonID = Me.person_ID
stDocName = "frmEvents"
stLinkCriteria = "[Person_ID] = " & intPersonID

DoCmd.OpenForm stDocName
Form_frmEvents.ServerFilter = "[Collection_Events_B] <> 0"
Form_frmEvents.Requery

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top