473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Conditional Formation only works when GotFocus

reginaldmerritt
201 100+
I have code that selects a record from a PopUp Search Form which then sets a bound control for that record ([HighlightLine)] to True. It then sets conditional formatting based on that control for various other controls.

Conditional Formatting is Expression: "[HighlightLine] = True"

This works fine but only if I click directly onto a control with the formatting, i.e only when a control has focus, otherwise the controls Conditional Formatting does not apply.

Does Expression Formatting only apply when a control has focus or is there another setting somewhere?

Thanks
Sep 20 '10 #1
1 2294
reginaldmerritt
201 100+
This is the code I'm using. Is there anything in here that makes expression conditional formatting only work when the control has focus?

Any help would be great.

Expand|Select|Wrap|Line Numbers
  1. Private Sub ViewCallLog_Click()
  2.  Dim rst As Recordset
  3.  Dim lngYellow As Long
  4.  
  5. lngYellow = RGB(255, 255, 0)
  6.  
  7. If CurrentProject.AllForms("FRMClaims").IsLoaded Then
  8.     DoCmd.Close acForm, "FRMClaims"
  9.  
  10.     DoCmd.OpenForm "FRMClaims"
  11.  
  12.     'Run query Set to False previous fields where HilightLine = True
  13.     DoCmd.SetWarnings False
  14.     DoCmd.OpenQuery "QYUpdateTBClaimsHighlightLine"
  15.     DoCmd.SetWarnings True
  16.  
  17.     'Set focus to selected record
  18.     'Forms!FRMClaims.ClaimsDisplaySubForm.Form.CompleationStatusID.SetFocus
  19.  
  20.     Set rst = Forms!FRMClaims.ClaimsDisplaySubForm.Form.RecordsetClone
  21.  
  22.     rst.FindFirst "[ClaimID] = " & Me.ClaimID
  23.  
  24.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.Bookmark = rst.Bookmark
  25.  
  26.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.CompleationStatusID.SetFocus
  27.  
  28.     rst.Close
  29.  
  30.     Set rst = Nothing
  31.  
  32.  
  33.     'Set Feild on Table to true on record that has focus(as laid out above)
  34.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.HighlightLine = True
  35.  
  36.     'Remove Format Conditions
  37.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.LearnerFullName.FormatConditions.Delete
  38.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.AssessorID.FormatConditions.Delete
  39.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.QualificationID.FormatConditions.Delete
  40.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.Level.FormatConditions.Delete
  41.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.EmployerID.FormatConditions.Delete
  42.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.FundingStreamID.FormatConditions.Delete
  43.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.StartDate.FormatConditions.Delete
  44.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.PlannedEndDate.FormatConditions.Delete
  45.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.ActualEndDate.FormatConditions.Delete
  46.  
  47.     'Add Format Conditions
  48.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.LearnerFullName.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  49.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.LearnerFullName.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  50.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.AssessorID.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  51.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.QualificationID.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  52.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.Level.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  53.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.EmployerID.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  54.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.FundingStreamID.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  55.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.StartDate.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  56.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.PlannedEndDate.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  57.     Set objFrc = Forms!FRMClaims.ClaimsDisplaySubForm.Form.ActualEndDate.FormatConditions.ADD(acExpression, , "[HighlightLine] = True")
  58.     'Set Format Conditions
  59.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.LearnerFullName.FormatConditions(0).BackColor = lngYellow
  60.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.AssessorID.FormatConditions(0).BackColor = lngYellow
  61.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.QualificationID.FormatConditions(0).BackColor = lngYellow
  62.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.Level.FormatConditions(0).BackColor = lngYellow
  63.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.EmployerID.FormatConditions(0).BackColor = lngYellow
  64.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.FundingStreamID.FormatConditions(0).BackColor = lngYellow
  65.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.StartDate.FormatConditions(0).BackColor = lngYellow
  66.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.PlannedEndDate.FormatConditions(0).BackColor = lngYellow
  67.     Forms!FRMClaims.ClaimsDisplaySubForm.Form.ActualEndDate.FormatConditions(0).BackColor = lngYellow
  68.  
  69. End If
  70.  
  71. If CurrentProject.AllForms("FRMHome").IsLoaded Then
  72.     MsgBox ("FRMHome IsLoaded")
  73.     DoCmd.Close acForm, "FRMHome"
  74.     DoCmd.OpenForm "FRMCallLog", , , "[ClaimID] =" & Me.ClaimID
  75. End If
  76.  
  77. If CurrentProject.AllForms("FRMLearnersDetails").IsLoaded Then
  78.     DoCmd.Close acForm, "FRMLearnersDetails"
  79.     DoCmd.OpenForm "FRMCallLog", , , "[ClaimID] =" & Me.ClaimID
  80. End If
  81.  
  82. DoCmd.Close acForm, "FRMBasicLearnerSearch"
  83.  
  84. End Sub
  85.  
  86.  
Sep 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: pigeon | last post by:
SSL only works when ms sql server has "force encryption option" turned on... If I turn that off, and try to have the client software request encryption.. I get a ssl security error msg. The...
3
by: Andy Stevenson | last post by:
Hi, As subject, I have the following JS in my HTML document & it works fine: <SCRIPT type="text/JavaScript"> <!-- COPYRIGHT = " : Copyright &copy; Diverse Arts., 2003-"; function...
3
by: Tim | last post by:
hi, I have some code that works in all web browsers except IE 5.2 for Mac (heard this one before? :-) the CSS code basically creates two id's, one is a container for the other. eg: CSS...
2
by: Daniel Beardsley | last post by:
I have a div with some text in it and an onclick event. The onclick event only seems to fire when the user clicks the text.. not if they click the blank part of the div. This is in IE 6. The...
1
by: Ethan Strauss | last post by:
Hi, I have a C#.net Web application which calls a web service (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/eutils.wsdl). It has run just fine for months. Recently I started getting...
1
by: Wessman | last post by:
sending mail using function mail() only works when I'm connected to mysql. <? mail($to, $subject, "before mysql_connect()", "From: $from"); mysql_connect("localhost", $username, $password);...
1
by: Ted | last post by:
In MS SQL I used the following to create a stored procedure. USE AdventureWorks; GO IF OBJECT_ID ( 'HumanResources.usp_My_Search', 'P' ) IS NOT NULL DROP PROCEDURE HumanResources.usp_My_Search;...
4
by: clentoc | last post by:
I'm pretty new to javascript so this may well be a really basic error, but I've spent hours trying to fix it with no joy. I have written some code which looks in a CSV file, filters it depending...
0
by: shuu | last post by:
Hi I have a application that captures the screen och sends the images to a server. I want to save the destination URL's (like: http://domain.com/dump/img.jpg) to the clipboard, but this only...
15
by: postman | last post by:
Any idea why code would work as intended when setting a breakpoint and stepping through it line by line, but won't work correctly at run-time? The code is too much to post, so I hope this summary...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.