Is there a way to create color labels based on a query in access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a label report, but I would like to add a different color
based on the "Records Series" field. Ie. any records assigned to ACC would
be Blue in either font color or highlighted in blue, or any records assgined
to LGL would be Red.

Thanks!
 
I have created a label report, but I would like to add a different color
based on the "Records Series" field. Ie. any records assigned to ACC would
be Blue in either font color or highlighted in blue, or any records assgined
to LGL would be Red.

Thanks!
Which Access Version.
If your version of Access supports Conditional Formatting:

Select on the label. Click on Format + Conditional formatting.
Set Condition1 to Expression Is.
Set the expression to:
[RecordSeries] ="ACC"
Select your ForeColor.
Click Add.
Set Condition2 to Expression Is.
Set the Expression to:
[RecordSeries] ="LGL"
Select this condition's ForeColor.
Click OK to save the changes.

Or..
Using any version of Access, by code in the Detail Format event.
If [RecordSeries] = "ACC" Then
[LabelName].ForeColor = vbBlue
Elseif [RecordSeries] = "LGL" Then
[LabelName].ForeColor = vbRed
Else
[LabelName].ForeColor = vbBlack
End If
 
What does [LabelName] represent?

Ember

fredg said:
I have created a label report, but I would like to add a different color
based on the "Records Series" field. Ie. any records assigned to ACC would
be Blue in either font color or highlighted in blue, or any records assgined
to LGL would be Red.

Thanks!
Which Access Version.
If your version of Access supports Conditional Formatting:

Select on the label. Click on Format + Conditional formatting.
Set Condition1 to Expression Is.
Set the expression to:
[RecordSeries] ="ACC"
Select your ForeColor.
Click Add.
Set Condition2 to Expression Is.
Set the Expression to:
[RecordSeries] ="LGL"
Select this condition's ForeColor.
Click OK to save the changes.

Or..
Using any version of Access, by code in the Detail Format event.
If [RecordSeries] = "ACC" Then
[LabelName].ForeColor = vbBlue
Elseif [RecordSeries] = "LGL" Then
[LabelName].ForeColor = vbRed
Else
[LabelName].ForeColor = vbBlack
End If
 
Never mind, I figured it out!!! Thanks "fredg", I really appreciate the post!

Ember

Ember said:
What does [LabelName] represent?

Ember

fredg said:
I have created a label report, but I would like to add a different color
based on the "Records Series" field. Ie. any records assigned to ACC would
be Blue in either font color or highlighted in blue, or any records assgined
to LGL would be Red.

Thanks!
Which Access Version.
If your version of Access supports Conditional Formatting:

Select on the label. Click on Format + Conditional formatting.
Set Condition1 to Expression Is.
Set the expression to:
[RecordSeries] ="ACC"
Select your ForeColor.
Click Add.
Set Condition2 to Expression Is.
Set the Expression to:
[RecordSeries] ="LGL"
Select this condition's ForeColor.
Click OK to save the changes.

Or..
Using any version of Access, by code in the Detail Format event.
If [RecordSeries] = "ACC" Then
[LabelName].ForeColor = vbBlue
Elseif [RecordSeries] = "LGL" Then
[LabelName].ForeColor = vbRed
Else
[LabelName].ForeColor = vbBlack
End If
 

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

Back
Top