Solved

Highlight certain fields on continuous form

Posted on 2014-02-25
3
378 Views
Last Modified: 2014-02-25
Good morning experts,

I have a continuous form.  This includes a Yes/No field called "Waived"
I want to include a description on the continuous form, rather than the tick itself.

I have added a text box called WaivedText, containing the text "Waived" and set its Visible property to No.

I then included the following code for the Section OnPaint event:

Private Sub Detail_Paint()
If Me.Waived = True Then
WaivedText.Visible = True
End If
End Sub

But this will not work because I get the error:
"You can't change the value of this property in the OnPaint event."

I couldn't quite figure out where it should be.

Appreciate some help on this.

Regards

Richard
0
Comment
Question by:rltomalin
  • 2
3 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39885153
Use conditional formatting.

Right-click the control in design view and select Conditional Formatting...

Select "Expression Is" from the drop-down list, and place this in the box provided:

[Waived] = True 

Open in new window



Then set your formatting options to disguise the text.  ("Visible" is not an option, so just disguise it with text color, etc)
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39885162
Alternatively, you can simply clear the text from your textbox based on the value of Waived.

Just set the control source of your textbox to (include the = sign):

= IIF(Waived = True, "Waived", "")

Open in new window



That will display Waived when Waived is true, and will be blank when Waived is false.
0
 

Author Closing Comment

by:rltomalin
ID: 39885186
Hi mbizup

That's great, thanks.  I like the second suggestion best, so that's what I will do.  Works fine.

Regards

Richard
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now