Re: Highlight current record
- From: RobGMiller <RobGMiller@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 5 Jun 2008 06:03:01 -0700
If I view the value of Forms!ParentForm!LineNumber immediatly after setting
it in the OnCurrent event as you suggest it shows the correct value for the
current record.
If the conditional formatting of the controls on the current record occurs
after the OnCurrent event is done then the correct value should be returned.
What might prevent the conditionnal formatting process to run in a normal
sequence?
What is the normal sequence of events that occur as a control on a record
gets the focus in a subform in continuous forms view?
--
RobGMiller
"Jeanette Cunningham" wrote:
Rob,.
I noticed that you used the expression
Me!LineNumber = ParentForm!LineNumber
Instead of ParentForm!LineNumber
use
Parent!LineNumber
As an aid to debug it, try code like this on the form's On Current event
Debug.Print "Parent!LineNumber: " & Parent!LineNumber
Debug.Print "Me!LineNumber: " & Me!LineNumber
Run the form, then go Ctl + G to open the immediate window and see what
values access found for the line number.
Jeanette Cunningham -- Melbourne Victoria Australia
"RobGMiller" <RobGMiller@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:510E8DAE-E0B6-4834-99FD-97F3776832D9@xxxxxxxxxxxxxxxx
Access 2003.
Need to highlight the current record on a subform setup in continuous
forms
view.
I found a way to do it a long time ago by setting the value of a control
on
the main or parent form to the value of a LineNumber control on the
current
record of the subform which is always a unique value. This is done in the
OnCurrent event of the subform. As you move through the records the
OnCurrent
event fires and updates the Parentform control.
In Conditional formatting for a field that never gets the focus I change
the
background color if Expression Is: Me!LineNumber = ParentForm!LineNumber
or
somethign to that effect.
This worked perfectly until recently. If you clicked on a record or move
to
it using the cursor(arrow) keys the background would change color. Now the
background color will only change color if a record is updated due to a
change in value of one of its controls.
I've made many changes to this application since this technique last
worked.
None of which seems related to this type of thing. I though someone might
have some insight as to how the Conditional Formatting works. i.e. What
triggers the formatting of all the controls on a record when the record or
one of its controls gets the focus.
I am sure that no background code runs as different records get the focus
unless something is changed. I've tried repaint instead of refresh which
was
used after the value of the ParentForm control is set from the OnCurrent
Event of the subform. Requery looses the focus alltogether so its useless
in
this case.
RobGMiller
- Follow-Ups:
- Re: Highlight current record
- From: Jeanette Cunningham
- Re: Highlight current record
- References:
- Re: Highlight current record
- From: Jeanette Cunningham
- Re: Highlight current record
- Prev by Date: Re: Command Button Question
- Next by Date: Re: Guidance on entering and display date & time
- Previous by thread: Re: Highlight current record
- Next by thread: Re: Highlight current record
- Index(es):