Solved

Highlight certain fields on continuous form

Posted on 2014-02-25
3
388 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

789 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