Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Access 2013 Programming
This is the forum to discuss the Wrox book Professional Access 2013 Programming by Teresa Hennig, Ben Clothier, George Hepworth, Dagi (Doug) Yudovich; ISBN: 978-1-118-53083-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Access 2013 Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 26th, 2014, 08:51 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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:

Code:
If [First_NameTextBox] = "somevalue" Then
    SetProperty
        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?
  #2 (permalink)  
Old July 26th, 2014, 07:52 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2014
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
  #3 (permalink)  
Old July 28th, 2014, 03:53 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Indeed it was. What was I thinking? Thanks.


Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing controls in code behind Will BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 March 3rd, 2009 02:38 PM
dynamic controls - referencing keyops VB.NET 0 February 14th, 2006 03:50 PM
Referencing Html Controls ~Bean~ ASP.NET 1.0 and 1.1 Basics 3 September 30th, 2005 09:11 AM
referencing controls in templates in form_view djpotte ASP.NET 2.0 Basics 3 May 25th, 2005 04:23 PM





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