Access2003-record design

Y

yaniv

Hi
I have a form with all the records from a table. i have a push button in
this form.
I want to change the selected record color to red when ill push the button.
How can i do it?
Thanks
Yaniv
 
T

Tom van Stiphout

On Tue, 12 Aug 2008 13:15:01 -0700, yaniv

Check into "Conditional Formatting" in the help file.
The button click could run some code to set a (possibly hidden) field
in the form to True for the current row, all others to False, and
Conditional Formatting can set all the True rows to Red.

-Tom.
Microsoft Access MVP
 
Y

yaniv

Hi tom
thanks, but i dont want to use the "Conditional Formatting", i want to build
a few buttons to help the users highlights with different colors the records
in that form.
theres no connection between the color of the records and its content.
Yaniv
 
T

Tom van Stiphout

On Wed, 13 Aug 2008 05:28:00 -0700, yaniv

I'm afraid you have reached a dead end then.

I was suggesting you would add an additional field e.g. IsRed (YesNo,
Required, Default=False) that would serve the purpose of indicating
which rows should be red.

-Tom.
Microsoft Access MVP
 
Y

yaniv

Hi tom
I would like to try it.
Can you please be more specific about the way ?
I have no idea how to do it.
Thanks a lot
Yaniv
 
C

Clif McIrvin

yaniv said:
Hi tom
I would like to try it.
Can you please be more specific about the way ?
I have no idea how to do it.
Thanks a lot
Yaniv

Yaniv, are you saying that you want the form to 'remember' the color
after the user set it with the command button? That is, 1) the user
scrolls away from the record, then scrolls back - the record should
still be red. and 2) Tomorrow, when the user looks at this record again,
it should still be red?

If that is the case, what Tom suggested here will work.

You will need to:

1. Add a new field [IsRed] to the table.
2. Add code to the Current Event of the form to set the background color
of all the controls on the form that are bound to this recordsource
(table) to red if [IsRed] is True, normal otherwise.
3. Add code to the OnClick Event of the command button to set [IsRed] to
True.

What version of Access are you using?
 
Y

yaniv

Hi clif
First - Thank you very much.
Second - I did what you wrote in paragraphs 1 & 3.
About paragraph 2 - Ill really appreciate it if you’ll give me the exact
code that I have to put in the “Current Event†of the form.
Thanks again
(Sorry for the ignorance but I’m still learning Access 2003 ☺)
Yaniv

Clif McIrvin said:
yaniv said:
Hi tom
I would like to try it.
Can you please be more specific about the way ?
I have no idea how to do it.
Thanks a lot
Yaniv

Yaniv, are you saying that you want the form to 'remember' the color
after the user set it with the command button? That is, 1) the user
scrolls away from the record, then scrolls back - the record should
still be red. and 2) Tomorrow, when the user looks at this record again,
it should still be red?

If that is the case, what Tom suggested here will work.

You will need to:

1. Add a new field [IsRed] to the table.
2. Add code to the Current Event of the form to set the background color
of all the controls on the form that are bound to this recordsource
(table) to red if [IsRed] is True, normal otherwise.
3. Add code to the OnClick Event of the command button to set [IsRed] to
True.

What version of Access are you using?
 

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