D
Denver
I have a form with a subform and a combo box(Combo58)....
i have the following codes...
everything is working but THE ONLY PROBLEM IS THAT ONCE I SELECT 'All
Location' IT DOESNT REMOVE THE FILTERS OR DISPLAY ALL THE RECORDS I HAVE IN
THE SUBFORM.... IS THERE ANYONE IS KIND TO HELP ME?? IAM USING ACCESS 2003.
WHAT DO I MISS THRU THIS CODE?
I have this as my RowSource for my Combo58.....
SELECT DISTINCT location FROM [Data Entry2] UNION SELECT ' All Locations'
FROM [Data Entry2] ORDER BY location;
and i have this as my event for Combo58...
Dim SQL As String
SQL = "SELECT [Data Entry2].[Site ID],[Data Entry2].[Site Name]," & _
vbCrLf & "[Data Entry2].[Drawing Ref] , [Data Entry2].[Sheet No], [Data
Entry2].Rev, [Data Entry2].Description," & _
vbCrLf & "[Data Entry2].[Drwg Typ], [Data Entry2].[Drawing Title], [Data
Entry2].[Rd Line], [Data Entry2].[TR Rd Line]," & _
vbCrLf & "[Data Entry2].[TR Rd Line Date], [Data Entry2].AsBuilt, [Data
Entry2].[Forecast (SubCon)]," & _
vbCrLf & "[Data Entry2].[Reviewed Red Line], [Data Entry2].[Reviewed (%)],"
& _
vbCrLf & "[Data Entry2].[Forecast (SLSA)], [Data Entry2].[Reviewed Red
Line(PMT)], [Data Entry2].[TR Rd Line(PMT)]," & _
vbCrLf & "[Data Entry2].[TR Rd Line(PMT) Date], [Data Entry2].[Reviewed (%)
PMT], [Data Entry2].[Forecast PMT]," & _
vbCrLf & "[Data Entry2].SubContractor, [Data Entry2].CWP, [Data Entry2].[CWP
Title], [Data Entry2].Index," & _
vbCrLf & "[Data Entry2].DISCIPLINE, [Data Entry2].Prefix, [Data
Entry2].Size," & _
vbCrLf & "[Data Entry2].size_value, [Data Entry2].[Qty of Sheets], [Data
Entry2].[Eqv_A_Size]," & _
vbCrLf & "[Data Entry2].[Earned ASize], [Data Entry2].[Physical Prog],
[Data Entry2].TR, [Data Entry2].Date," & _
vbCrLf & "[Data Entry2].SubCon, [Data Entry2].Location, [Data
Entry2].[Drawing Control No] FROM [Data Entry2];"
If Me!Combo58 = " All Locations" Then
Me.FilterOn = False
Else
Me.Filter = "location = '" & Me![Combo58] & " '"
Me.FilterOn = True
End If
THANKS
i have the following codes...
everything is working but THE ONLY PROBLEM IS THAT ONCE I SELECT 'All
Location' IT DOESNT REMOVE THE FILTERS OR DISPLAY ALL THE RECORDS I HAVE IN
THE SUBFORM.... IS THERE ANYONE IS KIND TO HELP ME?? IAM USING ACCESS 2003.
WHAT DO I MISS THRU THIS CODE?
I have this as my RowSource for my Combo58.....
SELECT DISTINCT location FROM [Data Entry2] UNION SELECT ' All Locations'
FROM [Data Entry2] ORDER BY location;
and i have this as my event for Combo58...
Dim SQL As String
SQL = "SELECT [Data Entry2].[Site ID],[Data Entry2].[Site Name]," & _
vbCrLf & "[Data Entry2].[Drawing Ref] , [Data Entry2].[Sheet No], [Data
Entry2].Rev, [Data Entry2].Description," & _
vbCrLf & "[Data Entry2].[Drwg Typ], [Data Entry2].[Drawing Title], [Data
Entry2].[Rd Line], [Data Entry2].[TR Rd Line]," & _
vbCrLf & "[Data Entry2].[TR Rd Line Date], [Data Entry2].AsBuilt, [Data
Entry2].[Forecast (SubCon)]," & _
vbCrLf & "[Data Entry2].[Reviewed Red Line], [Data Entry2].[Reviewed (%)],"
& _
vbCrLf & "[Data Entry2].[Forecast (SLSA)], [Data Entry2].[Reviewed Red
Line(PMT)], [Data Entry2].[TR Rd Line(PMT)]," & _
vbCrLf & "[Data Entry2].[TR Rd Line(PMT) Date], [Data Entry2].[Reviewed (%)
PMT], [Data Entry2].[Forecast PMT]," & _
vbCrLf & "[Data Entry2].SubContractor, [Data Entry2].CWP, [Data Entry2].[CWP
Title], [Data Entry2].Index," & _
vbCrLf & "[Data Entry2].DISCIPLINE, [Data Entry2].Prefix, [Data
Entry2].Size," & _
vbCrLf & "[Data Entry2].size_value, [Data Entry2].[Qty of Sheets], [Data
Entry2].[Eqv_A_Size]," & _
vbCrLf & "[Data Entry2].[Earned ASize], [Data Entry2].[Physical Prog],
[Data Entry2].TR, [Data Entry2].Date," & _
vbCrLf & "[Data Entry2].SubCon, [Data Entry2].Location, [Data
Entry2].[Drawing Control No] FROM [Data Entry2];"
If Me!Combo58 = " All Locations" Then
Me.FilterOn = False
Else
Me.Filter = "location = '" & Me![Combo58] & " '"
Me.FilterOn = True
End If
THANKS