Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2005

Tip: Looking for answers? Try searching our database.

change color of detail when filter is applied

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Donna - 06 Mar 2005 22:03 GMT
When a filter has been applied, I would like the detail background color to
change so they know they are looking at a filtered dataset.  I tried the code
below, but all that changes is the filter by form screen BEFORE they apply
the filter.  I need it to change color after they apply the filter.   What am
I doing wrong? Thanks in advance!

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
   Me.Detail.BackColor = -2147483633
End Sub

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
   Me.Detail.BackColor = 255
End Sub
fredg - 07 Mar 2005 02:41 GMT
> When a filter has been applied, I would like the detail background color to
> change so they know they are looking at a filtered dataset.  I tried the code
[quoted text clipped - 9 lines]
>     Me.Detail.BackColor = 255
> End Sub

Just use the ApplyFilter event.

If Me.Section(0).BackColor = -2147483633 Then
      Me.Section(0).BackColor = 255
   Else
       Me.Section(0).BackColor = -2147483633
End If

I'm not sure which color you wish when the filter is applied.
The above colors the detail section Red when applied and returns it to
the normal color when filter is off.

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Max Brassfield - 07 Mar 2005 22:57 GMT
I was messing around with a report for home the tracks Keno Numbers and wanted the number on my report to change color
when the number hit and found this to work quite well rather than setting the way you are doing.  Doing it that way
would work for the first one but the remaining numbers would not do anything.  The first section compares the first 2
numbers to the remaining of all 80 numbers.  The Ctl1 is the #1 of 80 compared to COL1 one of five drawn and would turn
red if matched.  The Case else made it stay white.  Anyway it worked for me.  The most frustrating thing I have found
with Access is figuring out how to ask the question to get the answer I want

Found it on this website  http://www.lebans.com/toc.htm

Max
Fernley NV

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Select Case Me.Ctl1

   Case Is = Me.COL1
   Me.Ctl1.BackColor = 14737632

   Case Is = Me.COL2
   Me.Ctl1.BackColor = 14737632

   Case Is = Me.COL3
   Me.Ctl1.BackColor = 14737632

   Case Is = Me.COL4
   Me.Ctl1.BackColor = 14737632

   Case Is = Me.COL5
   Me.Ctl1.BackColor = 14737632
   Case Else
   Me.Ctl1.BackColor = 16777215
   End Select

Select Case Me.Ctl2
   Case Is = Me.COL1
   Me.Ctl2.BackColor = 14737632

   Case Is = Me.COL2
   Me.Ctl2.BackColor = 14737632

   Case Is = Me.COL3
   Me.Ctl2.BackColor = 14737632

   Case Is = Me.COL4
   Me.Ctl2.BackColor = 14737632

   Case Is = Me.COL5
   Me.Ctl2.BackColor = 14737632
   Case Else
   Me.Ctl2.BackColor = 16777215
   End Select

End Sub
When a filter has been applied, I would like the detail background color to
change so they know they are looking at a filtered dataset.  I tried the code
below, but all that changes is the filter by form screen BEFORE they apply
the filter.  I need it to change color after they apply the filter.   What am
I doing wrong? Thanks in advance!

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
   Me.Detail.BackColor = -2147483633
End Sub

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
   Me.Detail.BackColor = 255
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.