p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Access 2013 Programming (http://p2p.wrox.com/forumdisplay.php?f=747)
-   -   Referencing controls (http://p2p.wrox.com/showthread.php?t=92294)

stefankemp February 26th, 2014 08:51 AM

Referencing controls
Hi, in a List view I want a particular control (textbox) to have a red background color if it has a certain value. I have tried the following:

Click on the textbox then click the Data icon in the context sensitive controls that appear. I can then see that the name of the control is First_NameTextBox. I then click anywhere on the List view and click the Actions icon in the context controls that appear to the right of the view. I select "On Current". I then create two steps that should be executed whenever a new record is activated:


If [First_NameTextBox] = "somevalue" Then
        Control Name    [First_NameTextBox]
        Property            BackColor
        Value                #FF0000
End If

However, this turns the textbox red no matter what the value in First_NameTextBox is. How do I reference the CURRENT value of the textbox?

BClothier July 26th, 2014 07:52 PM

Is it a case of being set red correctly initially but never unset? Wouldn't you need a Else to set property back to white?

stefankemp July 28th, 2014 03:53 PM

Indeed it was. What was I thinking? Thanks.

All times are GMT -4. The time now is 03:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.