Results 1 to 11 of 11
  1. #1
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22

    Making two label captions the same

    Hi guys,



    I have one label in a form say form a with a caption and I have another caption in another form say form b.

    I would like the caption value of form a to be the caption value of form b so that I only need to change the caption in form a and it reflects the same caption in form b.


    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not understanding the issue.

    Set the Caption property of label to whatever you want it to say.
    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.

  3. #3
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22
    I apologise for not making myself clear enough. The caption value in form a's label is 5. I want to set form b's caption value to be an expression i.e. form b's caption = form a's value.


    I need it this way, because I want to update the value in only one place without having to change it in two places. Hope this makes sense

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you talking about the form's caption (not a label control)?

    Requires code to set the form Caption property. I use only VBA, don't know if macro can do. In form b Open event, select [Event Procedure], click the ellipses (...) to open VBA editor, type code.

    Me.Caption = Forms!formA.Caption
    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.

  5. #5
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22
    Hi,

    I have attached two empty forms with labels to explain things better.

    Hope it clears things up.

    Thank you once again for your patience and assistance so far
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Labels can't have expressions. Can use VBA to change the Caption property.

    Why is this necessary? If label on frm_a always shows 10 why must label on frm_b be dependent?
    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.

  7. #7
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22
    Because the value of 10 will change with time

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    How is the label caption changed? Why not use textboxes?
    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.

  9. #9
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22
    I never thought of that. Really showing my lack of knowledge here. If I use two textboxes instead, can I just use an expression similar to what you showed me earlier to get it to work?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Expression in textbox on frm_b like:

    = Forms!frm_a.textboxname

    or

    = Forms!frm_a.label.Caption

    Set properties Locked Yes and TabStop No

    Issue with using textbox as label on form is that users can click into it.
    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.

  11. #11
    thebionicredneck2003 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2013
    Posts
    22
    Got ya. Thanks again

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

Similar Threads

  1. Keeping Column Captions when exporting expoting pivot table
    By UofAHogs in forum Import/Export Data
    Replies: 1
    Last Post: 06-04-2012, 12:46 AM
  2. Replies: 1
    Last Post: 03-17-2012, 08:49 PM
  3. Using table data as button captions
    By jecanne in forum Access
    Replies: 7
    Last Post: 11-13-2011, 04:56 PM
  4. Dynamic Form, Dynamic labels/ captions?
    By JFo in forum Programming
    Replies: 15
    Last Post: 10-12-2011, 08:33 PM
  5. Form with Label captions that size dynamically
    By karmacable in forum Forms
    Replies: 3
    Last Post: 09-26-2011, 10:09 PM

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