Continuous form colour fields

G

Guest

Hi all

Is there a way to get the current record 'highlighted' on a continuous form?
I have two subforms on a form and the user selects one record in the first
subform and then enters related records in the 2nd subform. I want the
current row to be highlighted so it is clear to the user which record it
relates to.

I tried adding the following code to the on current event but it colours all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
G

Guest

Excellent great thanks! Downloaded and will look at...

Wayne Morgan said:
Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


hughess7 said:
Hi all

Is there a way to get the current record 'highlighted' on a continuous
form?
I have two subforms on a form and the user selects one record in the first
subform and then enters related records in the 2nd subform. I want the
current row to be highlighted so it is clear to the user which record it
relates to.

I tried adding the following code to the on current event but it colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
G

Guest

I have tried to recreate this effect using Stephen's class modules but I
can't get it working. I have put the textbox txtBackground in the detail
section of my subform and when I open the form it resizes this text box to
the width of all my fields in the detail section and I can't see any data. I
have to go back in to design view and send to back to make the fields visible
but the rows are all grey (as designed in my form) and do not change to red.
Am I missing something?

Thanks in advance for any help.
Sue


hughess7 said:
Excellent great thanks! Downloaded and will look at...

Wayne Morgan said:
Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


hughess7 said:
Hi all

Is there a way to get the current record 'highlighted' on a continuous
form?
I have two subforms on a form and the user selects one record in the first
subform and then enters related records in the 2nd subform. I want the
current row to be highlighted so it is clear to the user which record it
relates to.

I tried adding the following code to the on current event but it colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
S

Stephen Lebans

In form Design view, select the TextBox control, txtBackground, and send it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


hughess7 said:
I have tried to recreate this effect using Stephen's class modules but I
can't get it working. I have put the textbox txtBackground in the detail
section of my subform and when I open the form it resizes this text box to
the width of all my fields in the detail section and I can't see any data.
I
have to go back in to design view and send to back to make the fields
visible
but the rows are all grey (as designed in my form) and do not change to
red.
Am I missing something?

Thanks in advance for any help.
Sue


hughess7 said:
Excellent great thanks! Downloaded and will look at...

Wayne Morgan said:
Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record in the
first
subform and then enters related records in the 2nd subform. I want
the
current row to be highlighted so it is clear to the user which record
it
relates to.

I tried adding the following code to the on current event but it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
G

Guest

Yes I did that and I can see the fields now but I don't get any highlight on
my subform rows?

Sue


Stephen Lebans said:
In form Design view, select the TextBox control, txtBackground, and send it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


hughess7 said:
I have tried to recreate this effect using Stephen's class modules but I
can't get it working. I have put the textbox txtBackground in the detail
section of my subform and when I open the form it resizes this text box to
the width of all my fields in the detail section and I can't see any data.
I
have to go back in to design view and send to back to make the fields
visible
but the rows are all grey (as designed in my form) and do not change to
red.
Am I missing something?

Thanks in advance for any help.
Sue


hughess7 said:
Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record in the
first
subform and then enters related records in the 2nd subform. I want
the
current row to be highlighted so it is clear to the user which record
it
relates to.

I tried adding the following code to the on current event but it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
W

Wayne Morgan

Are the controls for your fields set to a Transparent background so that the
highlighting textbox will show through them?

--
Wayne Morgan
MS Access MVP


hughess7 said:
Yes I did that and I can see the fields now but I don't get any highlight
on
my subform rows?

Sue


Stephen Lebans said:
In form Design view, select the TextBox control, txtBackground, and send
it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


hughess7 said:
I have tried to recreate this effect using Stephen's class modules but I
can't get it working. I have put the textbox txtBackground in the
detail
section of my subform and when I open the form it resizes this text box
to
the width of all my fields in the detail section and I can't see any
data.
I
have to go back in to design view and send to back to make the fields
visible
but the rows are all grey (as designed in my form) and do not change to
red.
Am I missing something?

Thanks in advance for any help.
Sue


:

Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record in
the
first
subform and then enters related records in the 2nd subform. I want
the
current row to be highlighted so it is clear to the user which
record
it
relates to.

I tried adding the following code to the on current event but it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
G

Guest

They weren't but they are now and still not working :-(. It doesn't change
the colour to red - you can see the field but it is the same colour as the
form detail background. Also, the field in focus has a grey background which
I don't understand when I have set the backgrounds to transparent?

Thanks in advance for any help.
Sue


Wayne Morgan said:
Are the controls for your fields set to a Transparent background so that the
highlighting textbox will show through them?

--
Wayne Morgan
MS Access MVP


hughess7 said:
Yes I did that and I can see the fields now but I don't get any highlight
on
my subform rows?

Sue


Stephen Lebans said:
In form Design view, select the TextBox control, txtBackground, and send
it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


I have tried to recreate this effect using Stephen's class modules but I
can't get it working. I have put the textbox txtBackground in the
detail
section of my subform and when I open the form it resizes this text box
to
the width of all my fields in the detail section and I can't see any
data.
I
have to go back in to design view and send to back to make the fields
visible
but the rows are all grey (as designed in my form) and do not change to
red.
Am I missing something?

Thanks in advance for any help.
Sue


:

Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record in
the
first
subform and then enters related records in the 2nd subform. I want
the
current row to be highlighted so it is clear to the user which
record
it
relates to.

I tried adding the following code to the on current event but it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
W

Wayne Morgan

Sue,

I think I'll need to see the file. If you don't mind, zip the file and email
it to (e-mail address removed).
 
W

Wayne Morgan

Sue,

The file has been returned, let me know if you don't receive it. The class
module ClsCondionalFormatting is looking for a unique id field textbox, in
this case called "customerid". I added a textbox to your form for the
ItineraryID, named it txtItineraryID and changed the code in the class
module to look for this textbox. It now works.

--
Wayne Morgan
MS Access MVP


hughess7 said:
They weren't but they are now and still not working :-(. It doesn't change
the colour to red - you can see the field but it is the same colour as the
form detail background. Also, the field in focus has a grey background
which
I don't understand when I have set the backgrounds to transparent?

Thanks in advance for any help.
Sue


Wayne Morgan said:
Are the controls for your fields set to a Transparent background so that
the
highlighting textbox will show through them?

--
Wayne Morgan
MS Access MVP


hughess7 said:
Yes I did that and I can see the fields now but I don't get any
highlight
on
my subform rows?

Sue


:

In form Design view, select the TextBox control, txtBackground, and
send
it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


I have tried to recreate this effect using Stephen's class modules
but I
can't get it working. I have put the textbox txtBackground in the
detail
section of my subform and when I open the form it resizes this text
box
to
the width of all my fields in the detail section and I can't see any
data.
I
have to go back in to design view and send to back to make the
fields
visible
but the rows are all grey (as designed in my form) and do not change
to
red.
Am I missing something?

Thanks in advance for any help.
Sue


:

Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record
in
the
first
subform and then enters related records in the 2nd subform. I
want
the
current row to be highlighted so it is clear to the user which
record
it
relates to.

I tried adding the following code to the on current event but
it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
S

Stephen Lebans

Thanks Wayne for helping the OP implement my code. I agree with your note to
me that the class should accept an object variable containing a reference to
the desired TextBox control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Wayne Morgan said:
Sue,

The file has been returned, let me know if you don't receive it. The class
module ClsCondionalFormatting is looking for a unique id field textbox, in
this case called "customerid". I added a textbox to your form for the
ItineraryID, named it txtItineraryID and changed the code in the class
module to look for this textbox. It now works.

--
Wayne Morgan
MS Access MVP


hughess7 said:
They weren't but they are now and still not working :-(. It doesn't
change
the colour to red - you can see the field but it is the same colour as
the
form detail background. Also, the field in focus has a grey background
which
I don't understand when I have set the backgrounds to transparent?

Thanks in advance for any help.
Sue


Wayne Morgan said:
Are the controls for your fields set to a Transparent background so that
the
highlighting textbox will show through them?

--
Wayne Morgan
MS Access MVP


Yes I did that and I can see the fields now but I don't get any
highlight
on
my subform rows?

Sue


:

In form Design view, select the TextBox control, txtBackground, and
send
it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


I have tried to recreate this effect using Stephen's class modules
but I
can't get it working. I have put the textbox txtBackground in the
detail
section of my subform and when I open the form it resizes this text
box
to
the width of all my fields in the detail section and I can't see
any
data.
I
have to go back in to design view and send to back to make the
fields
visible
but the rows are all grey (as designed in my form) and do not
change to
red.
Am I missing something?

Thanks in advance for any help.
Sue


:

Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record
in
the
first
subform and then enters related records in the 2nd subform. I
want
the
current row to be highlighted so it is clear to the user which
record
it
relates to.

I tried adding the following code to the on current event but
it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 
G

Guest

Hi Wayne

Only just seen this note on the newgroups but I did reply to your email
which hopefully you received. I have implemented the changes in my live
system as you instructed and it all worked wonderfully thanks :)

Sue

Wayne Morgan said:
Sue,

The file has been returned, let me know if you don't receive it. The class
module ClsCondionalFormatting is looking for a unique id field textbox, in
this case called "customerid". I added a textbox to your form for the
ItineraryID, named it txtItineraryID and changed the code in the class
module to look for this textbox. It now works.

--
Wayne Morgan
MS Access MVP


hughess7 said:
They weren't but they are now and still not working :-(. It doesn't change
the colour to red - you can see the field but it is the same colour as the
form detail background. Also, the field in focus has a grey background
which
I don't understand when I have set the backgrounds to transparent?

Thanks in advance for any help.
Sue


Wayne Morgan said:
Are the controls for your fields set to a Transparent background so that
the
highlighting textbox will show through them?

--
Wayne Morgan
MS Access MVP


Yes I did that and I can see the fields now but I don't get any
highlight
on
my subform rows?

Sue


:

In form Design view, select the TextBox control, txtBackground, and
send
it
to Back via the Menu Format-> Send To Back.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


I have tried to recreate this effect using Stephen's class modules
but I
can't get it working. I have put the textbox txtBackground in the
detail
section of my subform and when I open the form it resizes this text
box
to
the width of all my fields in the detail section and I can't see any
data.
I
have to go back in to design view and send to back to make the
fields
visible
but the rows are all grey (as designed in my form) and do not change
to
red.
Am I missing something?

Thanks in advance for any help.
Sue


:

Excellent great thanks! Downloaded and will look at...

:

Stephen Lebans has an example of this here:

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

--
Wayne Morgan
MS Access MVP


Hi all

Is there a way to get the current record 'highlighted' on a
continuous
form?
I have two subforms on a form and the user selects one record
in
the
first
subform and then enters related records in the 2nd subform. I
want
the
current row to be highlighted so it is clear to the user which
record
it
relates to.

I tried adding the following code to the on current event but
it
colours
all
the rows yellow rather than the current record?

Private Sub Form_Current()
Dim lngYellow As Long

lngYellow = RGB(255, 255, 0)

Me![ReviewDate].BackColor = lngYellow

Thanks in advance for any help.
Sue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top