Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having to click twice to move focus

Status
Not open for further replies.

missinglinq

Programmer
Feb 9, 2002
1,914
US
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:

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

The Missinglinq

Richmond, Virginia

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

The Conditional Formatting is:

Expression Is [FFlag] = -1

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Things that go BUMP in the night!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top