Results 1 to 4 of 4
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    Changing a label value in VBA

    Good Day All,

    We know that a value in a textbox can be changed using VBA. However I would like to change the value in a Label based on a condition. This is not working so I would like to know if it is prohibited.

    My code is as follows:
    Code:
    Me.Label246 = "Quotation Request"


  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    You need to set the caption property;

    Code:
    Me.Label246.Caption = "Quotation Request"
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks. Its working fine.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Alternatively, use a textbox with expression in ControlSource to serve as a dynamic 'label'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 10-10-2017, 03:01 AM
  2. Replies: 3
    Last Post: 10-08-2017, 12:53 PM
  3. Report / Label Format Changing Issue
    By Mike 54 in forum Reports
    Replies: 2
    Last Post: 11-09-2016, 10:10 AM
  4. Changing font color of just part of a label
    By NGFLNG1 in forum Access
    Replies: 3
    Last Post: 09-11-2015, 11:02 AM
  5. Replies: 1
    Last Post: 04-25-2014, 11:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums