A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional Formatting requiring Clicking twice to change records



 
 
Thread Tools Display Modes
  #1  
Old April 15th, 2008, 01:34 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Conditional Formatting requiring Clicking twice to change records

Was writing a little routine for someone who needed, with a datasheet or
continuous form, to have FieldTwo's back color change when FieldOne has focus.
I added a boolean field, FFlag, and set it with the following code:

Private Sub FieldOne_GotFocus()
Me.FFlag = -1
End Sub

Private Sub FieldOne_LostFocus()
Me.FFlag = 0
End Sub

and then used Conditional Formatting for FieldTwo

Expression Is [FieldOne] = -1

with the back color set as desired.

This works as expected with one exception. If you move to another control
within the current record, everything works correctly. But if you try to move
to a different record with the mouse, the formatting disappears from FieldTwo,
but the cursor stays on the FieldOne of the current record! In order to go to
another record you have to click on it a second time!

I've tried everything I can think of, including recreating the scenario with
a new db, made from scratch, in case it was some weird type of corruption,
with no luck.

If the Conditional Formatting is removed, the form works as it normally would!


Anyone with any ideas?

Running Access 2003/SP2 on Windows XP

Thanks!

Linq

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200804/1

  #2  
Old April 15th, 2008, 06:52 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Conditional Formatting requiring Clicking twice to change records

Correction:

The Conditional Formatting is

Expression Is [FFlag] = -1

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.