coding...

V

VAL

I am creating badges (name tags) and would like the status text box to have a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 
V

VAL

Yes, I have and it works. However, Access only offers three conditions, I
have 12... so I guess I don't have a choice to program this into an event
procedure and I really don't know how.

What I need is:
IIF Status = "D" > the background will be blue, the wording will read:
Participant
IIF Status = "S" > the background will be red, the wording will read: Speaker
IIF Status = "P" > the background will be purple, the wording will read:
Publisher

ect.

Can you help, please?

Duane Hookom said:
Have you considered using Conditional Formatting?

--
Duane Hookom
MS Access MVP
--

VAL said:
I am creating badges (name tags) and would like the status text box to have
a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 
D

Duane Hookom

You only showed three conditions and you didn't mention anything about
having already tried this.

I would add a BackGroundColor field to the table of each unique status. The
field should be Long Integer and contain the color values. Add this table to
your report's record source and add the field to your report's detail
section. Add code to the On Format event of the detail section like:

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(0).BackColor = Me.txtBackgroundColor
End Sub


--
Duane Hookom
MS Access MVP
--

VAL said:
Yes, I have and it works. However, Access only offers three conditions, I
have 12... so I guess I don't have a choice to program this into an event
procedure and I really don't know how.

What I need is:
IIF Status = "D" > the background will be blue, the wording will read:
Participant
IIF Status = "S" > the background will be red, the wording will read:
Speaker
IIF Status = "P" > the background will be purple, the wording will read:
Publisher

ect.

Can you help, please?

Duane Hookom said:
Have you considered using Conditional Formatting?

--
Duane Hookom
MS Access MVP
--

VAL said:
I am creating badges (name tags) and would like the status text box to
have
a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 
V

VAL

Thank you so much for again responding so quickly and, you are right, I did
only put three examples... I get the idea of what you are suggesting but I
am not sure I fully understand how to do it. I will give it a try.

Can you not write to me directly at (e-mail address removed)? It would be
easier for me to respond. But I understand if you wish to keep your privacy.

Thank you again! Hope I can make this work. I am very new at all this and
there doesn't seem to be a book for "intermediate" users.

Val

Duane Hookom said:
You only showed three conditions and you didn't mention anything about
having already tried this.

I would add a BackGroundColor field to the table of each unique status. The
field should be Long Integer and contain the color values. Add this table to
your report's record source and add the field to your report's detail
section. Add code to the On Format event of the detail section like:

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(0).BackColor = Me.txtBackgroundColor
End Sub


--
Duane Hookom
MS Access MVP
--

VAL said:
Yes, I have and it works. However, Access only offers three conditions, I
have 12... so I guess I don't have a choice to program this into an event
procedure and I really don't know how.

What I need is:
IIF Status = "D" > the background will be blue, the wording will read:
Participant
IIF Status = "S" > the background will be red, the wording will read:
Speaker
IIF Status = "P" > the background will be purple, the wording will read:
Publisher

ect.

Can you help, please?

Duane Hookom said:
Have you considered using Conditional Formatting?

--
Duane Hookom
MS Access MVP
--

I am creating badges (name tags) and would like the status text box to
have
a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 
V

VAL

It worked!!!! First try!!! THANK YOU.

Duane Hookom said:
You only showed three conditions and you didn't mention anything about
having already tried this.

I would add a BackGroundColor field to the table of each unique status. The
field should be Long Integer and contain the color values. Add this table to
your report's record source and add the field to your report's detail
section. Add code to the On Format event of the detail section like:

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(0).BackColor = Me.txtBackgroundColor
End Sub


--
Duane Hookom
MS Access MVP
--

VAL said:
Yes, I have and it works. However, Access only offers three conditions, I
have 12... so I guess I don't have a choice to program this into an event
procedure and I really don't know how.

What I need is:
IIF Status = "D" > the background will be blue, the wording will read:
Participant
IIF Status = "S" > the background will be red, the wording will read:
Speaker
IIF Status = "P" > the background will be purple, the wording will read:
Publisher

ect.

Can you help, please?

Duane Hookom said:
Have you considered using Conditional Formatting?

--
Duane Hookom
MS Access MVP
--

I am creating badges (name tags) and would like the status text box to
have
a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 
D

Duane Hookom

Glad you got it to work.
BTW: Most of us prefer to keep threads in the news groups. This is generally
so that questions and answers can be shared to the entire community. In very
rare cases, I will suggest that someone send me their mdb or make it
available for download from the web.

--
Duane Hookom
MS Access MVP
--

VAL said:
It worked!!!! First try!!! THANK YOU.

Duane Hookom said:
You only showed three conditions and you didn't mention anything about
having already tried this.

I would add a BackGroundColor field to the table of each unique status.
The
field should be Long Integer and contain the color values. Add this table
to
your report's record source and add the field to your report's detail
section. Add code to the On Format event of the detail section like:

Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(0).BackColor = Me.txtBackgroundColor
End Sub


--
Duane Hookom
MS Access MVP
--

VAL said:
Yes, I have and it works. However, Access only offers three
conditions, I
have 12... so I guess I don't have a choice to program this into an
event
procedure and I really don't know how.

What I need is:
IIF Status = "D" > the background will be blue, the wording will read:
Participant
IIF Status = "S" > the background will be red, the wording will read:
Speaker
IIF Status = "P" > the background will be purple, the wording will
read:
Publisher

ect.

Can you help, please?

:

Have you considered using Conditional Formatting?

--
Duane Hookom
MS Access MVP
--

I am creating badges (name tags) and would like the status text box
to
have
a
different background color depending on the registrants' status.

something like: =(IIF([Status]="C", ---------- set color to navy
-------------
=(IIF([Status]="D", ---------- set color to red -------------
=(IIF([Status]="B", ---------- set color to pink -------------
etc.

thank you in advance! (e-mail address removed)
 

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