Instead of using a line, use a textbox -- make it short and
wide like a line. Use conditional formatting for the
textbox backcolor so your lines can be different colors for
different records depending on your criteria <smile>
You will also want to set these properties:
Locked = True
Enabled = False
~~~
or are you using "Line" to mean the record of data?
TO HIGHLIGHT THE CURRENT RECORD IN A CONTINUOUS FORM
put the following textbox control on your form (I usually
put it in the footer since there is often more unused space)
name --> RecordID_current
visible --> no
make the following textbox control in the detail section of
your form:
name --> HighlightBox
left --> 0
top --> 0
width --> width of detail section
height --> height of detail section, like 0.2
enabled --> false
locked --> true
tabstop --> false
send this control to the back*
in the design view of the form, select HighlightBox
since HighlightBox is behind everything, you may need to
select it using the object drop-down (1st icon on the
formatting toolbar or combo in the Properties window at the
top)
conditional formatting
condition 1 --> Expression Is
--> [RecordID] = [RecordID_current]
example to also highlight a new record:
[RecordID_current] = nz([GrpID],RecordID_current)
change fill/back color to LIGHT YELLOW or light gray
or whatever color you want for your highlight
If my detail section background is White, I like to use
light yellow for a highlight
WHERE
RecordID is the controlname of your ID field control
then, in the form OnCurrent event, assign a value to the
unbound RecordID_current
being unbound, it will have the same value on every record
'~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Current()
Me.RecordID_current = IIf([NewRecord], 0, [RecordID])
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~
'needed in Access 2007
Private Sub Form_BeforeInsert()
Me.RecordID_current = me.RecordID
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~
where [RecordID] is the controlname (or fieldname)
corresponding to your unique ID.
Warm Regards,
Crystal
remote programming and training
http://MSAccessGurus.com
free video tutorials
http://www.YouTube.com/user/LearnAccessByCrystal
Access Basics
http://www.AccessMVP.com/strive4peace
free 100-page book that covers essentials in Access
*
have an awesome day
*