Link to home
Start Free TrialLog in
Avatar of inversojvo
inversojvoFlag for Germany

asked on

How can I change control property only for current record on the endless form?

I have an endless form and want to change the active control's appearence only for the current record, not for all records. Now, if I assign a function to the event "gotfocus", and this function changes some control's properties, I see these changes in all records, not only in current one. So, how can I (if it's possible at all) limit the control's appearence change to the current record?

Thanks in advance.
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

This is how contious form behaves.  I suggest for you to describe what exactly want to accomplish for us to suggest a diiferent way of doing it.

Mike
Avatar of inversojvo

ASKER

I've endless form of the size, which allows to show 4 records at one screen. Each record has ca. 15 fields, able to take focus. That means, that the screen at each moment has 60 controls, able to take focus. It's a bit too many and makes it difficult to recognize the active control at first glance.

For such situations on a single form I make 2 functions, which change some visual properties of active control to make it easy to notice. One function makes a control visible different from others and I set property OnGotFocus equal to it, another reset these visual properties back when I leave the control (OnLostFocus). This small trick is taken from Access Cookbook.
For a single form it works perfectly. For the endless form it makes the control different from all others on all 4 records, and it'll obviously distract the attention of user between all 4 "differently looking" controls. It looks hmmm... not quite ugly, but enough to want not to do it this way.. So, I thought, that the way around it might exist..
Avatar of pique_tech
pique_tech

You might try conditional formatting--it will do what you're asking, even in continuous forms.

In form design view, click on the field you want to have formatted.  Then click on Format -> Conditional Formatting, then choose from the various choices you have there.  For example, if you wanted all the even numbers in the field to be red, you'd select
Condition 1:  EXPRESSION IS  and in the empty box you'd type [NameOfField} Mod 2 = 0
then select the text color icon and select red.

I think this is what you meant.  Post here if not.
ASKER CERTIFIED SOLUTION
Avatar of pique_tech
pique_tech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Obviously, my first word above should have been "NOW ..."

Fat fingers.
2 pique tech: it works! Can not makes absolutely the same as with a function, but anyway smth. close.
Thank you very much - the answer was quick and helpful :)
Thanks, glad to help.

I checked and it only works for the current field; wouldn't it be nice if there were a "current record" option?  Oh well, apparently Microsoft knows what we need better than we do.   ; )
you can set it as a property of control, i.e. an object, available during design mode, but we don't have the object "current record" in design mode.
Of course, to mark somehow "current record" would be nice, but IMHO, it's more important to have a possibility to mark the active control. At least if to chose between these 2 functionalities. Even Microsoft can't do everything :)
Besides, namely this fact let me see a salary droping on my account each month, so I'm obviously don't mind, if MS leaves some stuff undone :=)