[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Textbox background color (report)

Posted on 2004-10-28
10
Medium Priority
?
333 Views
Last Modified: 2006-11-17
Hi experts !

I'd like to know how I could change, with Access97, the background of a textbox placed on a report. In fact, it'd be conditionnal, like if text1 <> text2, then text2.background = new color.

Thanks, code needed !
0
Comment
Question by:rouxjean
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 4

Expert Comment

by:CrossWired
ID: 12434139
   If MsgBox("Yes or No", vbYesNo) = vbYes Then
        Me.DESCR.BackColor = 0
        Me.DESCR.BackStyle = 1
    End If


Put this on the OnOpen event of your report, and of course set the condition to whatever you need

0
 
LVL 4

Expert Comment

by:CrossWired
ID: 12434164
what do you mena by text1 <> text2 what will you be comparing?
0
 
LVL 34

Expert Comment

by:flavo
ID: 12434363
try (not sure never done it)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  If Me.txt1 <> Me.txt2 Then
    Me.txt1.BackColor = vbBlue
  Else
    Me.txt1.BackColor = vbRed
  End If
End Sub
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rouxjean
ID: 12434393
CrossWired : The report is based on a table, so for each record, if the text1 content is different than the text's 2 contents...I need to change the color to text2. I don't have the backcolor propertie...
0
 
LVL 34

Expert Comment

by:flavo
ID: 12434458
rouxjean,

This is one of those "tricky" ones..

The text box control does have the BackColor property, just that the intelisense doesnt show it, so you cant use the list that pops up, youll have to type the whole word by hand.

Good Luck!

Dave
0
 

Author Comment

by:rouxjean
ID: 12434509
tried: Me.Texte42.BackColor = vbRed on the form onload event...its still white ! I'd also like to use RGB if possible...
0
 
LVL 4

Assisted Solution

by:CrossWired
CrossWired earned 1000 total points
ID: 12434536
be sure to change the style to solid vice Transparent
0
 
LVL 34

Accepted Solution

by:
flavo earned 1000 total points
ID: 12434565
report or form??

if its a report you need to use Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

vbBlue is a constant provide by access (actually = to 16711680)

To use RGB use

Me.Texte42.BackColor = RGB(red, green, blue)

replace red, green and blue above for your values (must be between 0-255)


Dave
0
 

Author Comment

by:rouxjean
ID: 12434738
Last thing...maybe off-topic but i can't use Me. because it can refer to query expressions of form controls. How can I ensure it works ?
Thanks !
0
 
LVL 34

Expert Comment

by:flavo
ID: 12434807
is it a form or report..

If its a form you should be using Form_Current(), report use Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

not sure what you are asking

CrossWired,

Ill leave this up too you, its getting WAY to late (1:15AM, need to get up in 4:30 hours)

Later!

Dave
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question