By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 2,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

Highlighting the CURRENT ROW in a Continuous Form

P: n/a
I'd like to highlight the Current Row in a continuous form using
Conditional Formatting VBA Code similar to as under in the CURRENT
Event of the Form:

My Field Names are as follows: Name, Age, Addr1, Addr2
Sample Code picked off this NG:

Private Sub Form_Current()
With Me.Controls("Age").FormatConditions _
.Add(acFieldHasFocus)
.BackColor = RGB(224, 224, 224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32, 160) ' blue with a hint of purple
End With
End Sub
I was'nt able to get the above code to work.

Could someone please write some sample code for the above 4 fields in
the current event that would help me achieve this.

Yes ... I have looked at Stephen Lebans' Code & it's brilliant, but
I'm looking at a different solution.

An help would be greatly appreciated.

Thx & Best Rgds,
Prakash.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You have two choices.

1) In the Current event set CF for each of the individual controls on
the current row/record.

2) As in the sample on my site, place a TextBox behind all of the
controls in your Detail section. Set the CF to call a function for each
control. Return TRUE if this is the current row.

In both cases you need a method to identify which/if any is the current
row.

The sample code you posted would only set CF for the single control
that has the focus.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Prakash Wadhwani" <pr*************@gmail.com> wrote in message
news:ca**************************@posting.google.c om...
I'd like to highlight the Current Row in a continuous form using
Conditional Formatting VBA Code similar to as under in the CURRENT
Event of the Form:

My Field Names are as follows: Name, Age, Addr1, Addr2
Sample Code picked off this NG:

Private Sub Form_Current()
With Me.Controls("Age").FormatConditions _
.Add(acFieldHasFocus)
.BackColor = RGB(224, 224, 224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32, 160) ' blue with a hint of purple
End With
End Sub
I was'nt able to get the above code to work.

Could someone please write some sample code for the above 4 fields in
the current event that would help me achieve this.

Yes ... I have looked at Stephen Lebans' Code & it's brilliant, but
I'm looking at a different solution.

An help would be greatly appreciated.

Thx & Best Rgds,
Prakash.


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.