Highligting data in report by clicking control bottom on a form

F

Fred's

Hi Folks,

I've tried to figure out how can I highligt specific record row on a
report, and this by clicking a check box on a form,
but till now no success. Consequantly, if anyome knows how can I do
that, please help me,

Thanking you in advance for your help!
Fred's
 
F

fredg

Hi Folks,

I've tried to figure out how can I highligt specific record row on a
report, and this by clicking a check box on a form,
but till now no success. Consequantly, if anyome knows how can I do
that, please help me,

Thanking you in advance for your help!
Fred's

You are asking a specific question, but you haven't given any of the
specifics.

Generically...

Code the Report's Detail Format event:
If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If

It looks best if you set each control's BackStyle property to
Transparent.

The form must be open when the report is run.
 
J

J_Goddard via AccessMonster.com

You would have to use code in the "on format" event of the report's detail
section. As long as the *form* is open, you can reference the checkbox:
forms!Myform!Mycheckbox, and format the report controls accordingly for
report row(s) that meet the criteria (there are a number of properties you
can use to change colour, fonts, borders, etc.). There is an important
caveat to this - the On Format procedure must also set the format to the
"normal" (i.e. your default) settings for each record that does not meet your
highlighting criteria.

Note that this technique will not "highlight a row" in the same way it would
be highlighted in a table by selecting it; it will only highlight the
individual controls.

hope this helps a bit.

John
 
J

J_Goddard via AccessMonster.com

Hi Fred -

So much easier and better looking!

Thanks - I learned something from that.

John



Hi Folks,
[quoted text clipped - 5 lines]
Thanking you in advance for your help!
Fred's

You are asking a specific question, but you haven't given any of the
specifics.

Generically...

Code the Report's Detail Format event:
If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If

It looks best if you set each control's BackStyle property to
Transparent.

The form must be open when the report is run.
 
F

Fred's

Hi Folks,
I've tried to figure out how can I highligt specific record row on a
report, and this by clicking a check box on a form,
but till now no success. Consequantly, if anyome knows how can I do
that, please help me,
Thanking you in advance for your help!
Fred's

You are asking a specific question, but you haven't given any of the
specifics.

Generically...

Code the Report's Detail Format event:
If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If

It looks best if you set each control's BackStyle property to
Transparent.

The form must be open when the report is run.



HI,
Do I need to repalce the some wording in the code by something? And
the "Jones" Refer to what?
Thanks for your help1
Fred's

If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If
 
F

fredg

Hi Folks,
I've tried to figure out how can I highligt specific record row on a
report, and this by clicking a check box on a form,
but till now no success. Consequantly, if anyome knows how can I do
that, please help me,
Thanking you in advance for your help!
Fred's

You are asking a specific question, but you haven't given any of the
specifics.

Generically...

Code the Report's Detail Format event:
If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If

It looks best if you set each control's BackStyle property to
Transparent.

The form must be open when the report is run.

HI,
Do I need to repalce the some wording in the code by something? And
the "Jones" Refer to what?
Thanks for your help1
Fred's

If forms!FormName!Check = True and Me![SomeControl] = "Jones" Then
Me.Section(0).BackColor = vbRed
Else
Me.Section(0).BackColor = vbWhite
End If

This is now a follow-up reply to your original question, and you still
haven't given the specific information needed to specifically answer
your question.

How would any of us know what your form name is, what the check box
name is or what the criteria is that tells Access to change the color
of the row. None of us are mind readers.

Yes you have to replace [Some Control] with the name of whatever
control on the report is used for the criteria.
Yes you need to change "Jones" with whatever the criteria value
actually is. It may, or may not, have to be enclosed within quotes,
depending upon what the datatype is.
Yes you have to replace FormName with whatever the actual name of the
form is.
Yes you have to replace Check with whatever the actual name of the
check box control on the form is.

Yes if you want specific answers you have to give the specific
information needed.
 

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