Format A Continuous Form

  • Thread starter Thread starter TJ
  • Start date Start date
T

TJ

I am working in Access 2K and have a continuous form that
displays between 1 and hundreds of records depending on
the query choices the user makes. While scrolling through
the recordset it is easy to lose your place. What I'd like
to do is somehow highlight the current selected record
(similar to how using the record selector in a table makes
the font and background colors reverse). Changing the
background color, bold the font, etc will affect ALL
records because they are form properties. Anyone have any
ideas on how I can simulate this (or otherwise make it
easier for the user to relocate the current record)?
 
Stephen Lebans may be able to help. Here is an example that will let you set
the sroll bar position. You may be able to use a button to return to the
current record this way.

http://www.lebans.com/SelectRow.htm

The form SetGetFormScrollBar should give you an example. It sets the scroll
bar at the desired record number. You should be able to retrieve the
currently selected record's record number with

Me.Recordset.AbsolutePosition

AbsolutePosition is zero based, so 0 would be record 1.
 
TJ said:
I am working in Access 2K and have a continuous form that
displays between 1 and hundreds of records depending on
the query choices the user makes. While scrolling through
the recordset it is easy to lose your place. What I'd like
to do is somehow highlight the current selected record
(similar to how using the record selector in a table makes
the font and background colors reverse). Changing the
background color, bold the font, etc will affect ALL
records because they are form properties. Anyone have any
ideas on how I can simulate this (or otherwise make it
easier for the user to relocate the current record)?



Make all of the controls in the detail section transparent
(BackStyle property). Then add a text box that's as big as
the entire section and use Send To Back (Format menu) to put
it behind all the other controls. Use Conditional
Formatting (Format menu) to get the text box's BackColor to
display a different color for the current record.

You can use a line of code in the form's Current event and a
hidden, unbound text box in the form's header to keep track
of the current record's key value:

Me.txtCurrentKey = Me.txtKeyField
 
Thanks, Marsh. Works like a charm!

TJ
-----Original Message-----




Make all of the controls in the detail section transparent
(BackStyle property). Then add a text box that's as big as
the entire section and use Send To Back (Format menu) to put
it behind all the other controls. Use Conditional
Formatting (Format menu) to get the text box's BackColor to
display a different color for the current record.

You can use a line of code in the form's Current event and a
hidden, unbound text box in the form's header to keep track
of the current record's key value:

Me.txtCurrentKey = Me.txtKeyField
 
Thanks, Wayne. The users really want to see the current
record 'highlighted' so it willjump out at them. Your idea
is great, though, and I'll keep it in mind for upcoming
projects.

TJ
 
Marsh, you seem to know a lot about conditional formatting. Maybe you
can help me with this:

I want to group records on a form, but there is no built-in sorting and
grouping for forms as for reports. It would seem that conditional
formatting would be useful for this. I cannot, however, get a control
to display conditionally based upon the value of ANOTHER control (e.g.,
odd/even ID #s will cause text fields to appear in different colors).
Do you have any other ideas?

Thanks,
Kate
 
PMJI,

Yes, you can set the conditional formatting based on the value of another
control. Change the first box from "Field value is" to "Expression is" then
in the next box type something like:

txtMyTextbox = 3
 
Thanks, Wayne. I actually have done that. I've set up the expression
to be an "[integer field] mod 2=0", so that evens and odds are different
colors. However, there are sometimes gaps in the integer (it was an
autonumber, and some values got deleted), so that sometimes two groups
of adjacent numbers are both even.

But what I'm REALLY hoping to do is format conditionally when a GROUP
changes. e.g., when the repeating number in a row changes to another
value. I tried doing this in the current event, but it is a continuous
form and changed the color of ALL the records when the group changed.

-Kate
 
Back
Top