Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407

    How can I center the form caption, eg me.form.caption = "Hello"

    Is it possible to place the form caption in the center of the form eg



    Me.Caption = "All entries for - " & DLookup("[company title]", "[application data]", " [company title] = forms![main menu]![combo1290] ")

    Display's All entries for - Company Name Here

    that works fine but it's aligned left in the form's title bar, I'd like to align it to center, can this be done in Access 2003 or WindowsXP?
    Just tweeking the general apperence a little and noticed this would look better centered.
    ps I have tried padding the front of the caption with spaces, it does sort of work but looks a bit odd as the text length changes.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I don't know of an alignment option for the form header bar. Could maybe type a bunch of spaces in front of "All".
    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
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    That's what i'm doing now, just looks a bit odd when the names change!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    MS probably figured centering is not a good idea because if user is allowed to resize form width, the centered title might not show.
    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
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    You might check out the Space() function to dynamically adjust the number of spaces. I'm curious why you use the DLookup(), as it appears the desired value is in the combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Good point, I'll check on the usage of that.

  7. #7
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Thanks Pbaldy, that was an incorrect reference, it should be...
    Me.Caption = "All entries for - " & DLookup("[company title]", "[application data]", " [company title] = forms![main menu]![setup options]![combo1290] ")

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Same question. Why DLookup for company title if company title is already in the combobox?

    Me.Caption = "All entries for - " & Forms![main menu]![setup options]![combo1290]

    Glad Paul remembered the Space() function.
    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
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Good point. I'll look into it...yep, Thanks for that, it will help speed things up with less dlookup's.
    still looking at the space() function.

  10. #10
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Just tried the Space(x) function, I have found that there is not enough space in the titla bar for this, it starts to blank out the end of the text if Space(50) is added to the caption.
    I'll just have to live with it.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    I was thinking more like

    Space(x - Len(CompanyName))

    where x was an appropriate value that resulted in the desired look as the length of the name changed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    This has the same problem, runs out of room and cuts of the end. thanks anyway, I'm going to live with for now.

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    I would think that would depend on proper choice of x, but I've never actually tried it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I just tested. My caption was only "MAIN". It works until I tried 129 as x. Only shows "MAI".
    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.

  15. #15
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    I gave up on that one, I've moved onto designing some reports form them now. Just posted a Question about creating dynamic reports.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 08-19-2013, 03:00 PM
  2. access 2007 runtime on win 7 64 bit "Trust Center"
    By chemil12009@hotmail.com in forum Access
    Replies: 3
    Last Post: 01-18-2013, 11:28 PM
  3. Replies: 5
    Last Post: 08-03-2012, 04:20 PM
  4. Replies: 2
    Last Post: 05-25-2012, 11:31 AM
  5. Replies: 1
    Last Post: 03-24-2010, 02:25 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