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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to single instance of active control in continuous form 2

Status
Not open for further replies.

ThomasLafferty

Instructor
Mar 14, 2005
549
US
How do I refer to the active control in a continuous subform in the CURRENT RECORD? If I try to use code to change the backcolor of the active control, it changes the backcolor of every instance of the control on my continuous form. What I am trying to do is show visually where my insertion point is in a given column of controls, not highlight the whole column, just a single instance of a control. (Hope that makes sense) In a continuous form, If a have a textbox pointing to a table with 75 records, I will have 75 instances of that textbox.

Tom

Live once die twice; live twice die once.
 
You can use conditional formatting.

Right click on your control in design view, and select Got Focus (I'm not exactly sure of the wording) from the drop down menu.
 
Sorry, I meant right-click the control and select Conditional Formatting. Then select Got Focus.
 
My gosh - duh! My form is already making use of conditional formatting, don't know why I didn't think of this...

Tom

Live once die twice; live twice die once.
 
Hmmm...not gonna do it for me. There is no got focus for conditional formatting, unless I misunderstood you. There is, of course a got focus event in the control's property sheet. What I just tried (no workee) was to create a text box with the name txtActiveControl. In the GotFocus event, I used this code:
Code:
Me.txtActiveControl.Value = "PaidHours"

In the conditional format for PaidHours I entered this expression:

Code:
[txtActiveControl].[Value]="PaidHours"

And this works swimmingly as far as Access detecting that this control is in fact active. The problem is that it changes the formatting of every instance of that control, not the instance where my insertion point is. This gives me an entire column of controls where the conditional format has been applied since I am using a continuous form. I'm hoping to use this to show the user where her insertion point is without changing the cursor. (unless of course you know how to make my cursor look like a large blinking rectangle) [ponder]

Tom

Live once die twice; live twice die once.
 
How are ya ThomasLafferty . . .

Depends on the conditions you have set, but try setting another condition (you can set up to 3). When in the conditional formatting window & you drop the combobox . . . do you see [purple]Field Has Focus![/purple]

Calvin.gif
See Ya! . . . . . .
 
Boy do I feel silly... I will try this in the morning. Incidentally, as I'm sure you have noticed, this is posted under another heading: Large Blinking Cursor. Maybe I should have titled it, "Blinking Idiot Developer..."

Tom

Live once die twice; live twice die once.
 
That was it...

Thanks again, Aceman.[medal]

Live once die twice; live twice die once.
 
Assuming it has the same origin as I am thinking it is, I like that quote, Tom! I know the thought/idea well, but I never saw that quote used just like that (that I can remember).

Anyway, just wanted to point out that I like that quote:

Life once die twice; life twice die once.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top