Unknown filter or parent/child relationship

E

EJO

Hello and thnks for the help folks!

I have an A2k mdb using SQL Server 7 as a backend. The mdb has a form
with a tabbed subform. the main form shows sites, the subform shows
service requests for sites. When tab 1 of the sub is selected it shows
open requests. Tab 2 shows completed/cancelled requests. Tab 3 should
show all requests regardless of site. The forms are not linked using
the master/child properties, but the criteria is set in a sql statement
when the tabs are selected. The problem is that I can see that the sub
is filtering the records on tab 3 regardless of the sql. I have
stepped through the entire code using the vba debugger and cannot see
anyplace that is setting a filter, so, the sub is ignoring my explicit
sql statement:

----------------------------------------------
Private Sub TabCtl37_Change()

Dim SRrecordset

Select Case Me.TabCtl37.Value
Case 0
SRrecordset = "SELECT * From SRtbl WHERE
(((SiteCode)=[Forms]![Site].[Form]![SiteCode]) AND ((Cancelled)=False)
AND ((Accept_Act) Is Null)) ORDER BY SR_Entered_Act;"
Me.RecordSource = SRrecordset0
Me.AllowAdditions = True
Me.AllowDeletions = False
Me.AllowEdits = True
Me.SR.SetFocus
Me.Label205.Visible = False
Me.LookupSR.Visible = False
Me.Cancelled_Date.Visible = False
Me.BilledLabel.Visible = False
Me.BilledDate.Visible = False
Me.Billed.Visible = False
Me.OldSiteCode.Visible = False
Case 1
SRrecordset = "SELECT * From SRtbl WHERE
(((SiteCode)=[Forms]![Site].[Form]![SiteCode]) AND (((Cancelled)=True)
OR ((Accept_Act) Is Not Null))) ORDER BY Install_Act;"
Me.RecordSource = SRrecordset1
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
Me.Label205.Visible = False
Me.LookupSR.Visible = False
Me.Cancelled_Date.Visible = True
Me.BilledLabel.Visible = True
Me.BilledDate.Visible = True
Me.Billed.Visible = True
Me.OldSiteCode.Visible = True
Case 2
SRrecordset = "SELECT * From SRtbl;"
Me.RecordSource = SRrecordset2
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = True
Me.Label205.Visible = True
Me.LookupSR.Visible = True
Me.LookupSR.SetFocus
Me.Cancelled_Date.Visible = True
Me.BilledLabel.Visible = True
Me.BilledDate.Visible = True
Me.Billed.Visible = True
Me.OldSiteCode.Visible = True
End Select
**********************************************************
Private Sub Form_Current()

Dim ctl As Control

If Me.SiteCode = "0000.0" Then

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox
Then
Controls(ctl.Name).Locked = True
End If
Next ctl

ElseIf Me.SiteCode <> "0000.0" Then

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox
Then
Controls(ctl.Name).Locked = False
End If
Next ctl

End If

Me.LookupSR.Locked = False
Me.LookupSR.Enabled = True
Me.Design_Act.Locked = True
Me.ConfigDue_Act.Locked = True
Me.ImpPlan_Act.Locked = True
Me.Site_Pkg_Act.Locked = True
Me.EngineeringComplete_Act.Locked = True

End Sub

-----------------------------------------------
 
E

EJO

PS> Previously, the table was set as the record source (instead of the
query), setting filters then applying them on or off would display the
intended records. This also necessitated not using the master/child
form links. Why would the form act differently using a query with
criteria vs. a filtered table?

The change from table to query is intended to speed performance of the
front end.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top