Results 1 to 5 of 5
  1. #1
    AnjJ is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    3

    Form Control left or top properties, or move method, not working

    I have a form in which I am trying to make a control and its label visible dependent on a user's response in a combo box, and to position both. I can make them visible but I can't control where they appear.
    I have the following code, trying both the Left property and the Move method:
    Dim myTextBox As TextBox


    Set myTextBox = Me![Lockbox #]
    MsgBox ("BEFORE: Left=" & myTextBox.Left)
    myTextBox.Left = 4000
    MsgBox ("AFTER: Left=" & myTextBox.Left)
    myTextBox.Move (300)
    MsgBox ("AFTER: Left=" & myTextBox.Left)
    All three times, the msgbox reads:
    Left=2820
    Any ideas? Any help would be appreciated. Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I do that. Sample code in form Open event:

    Me.tbxTMA.Top = 4979.952

    I don't declare a textbox object, just reference the control.

    I tested my code in other events and it works.


    BTW, advise not to use spaces or special characters/punctuation (underscore is exception) in names.
    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
    AnjJ is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    3

    Thanks but still doesn't work

    Thank you for the prompt response but no luck. Today I tried:
    MsgBox ("Top before=" & Me.[Lockbox #].Top)
    Me.[Lockbox #].Top = 4000
    MsgBox ("Top after=" & Me.[Lockbox #].Top)
    and got:

    Top before=6615
    Top after=6615

    and the thing just does not move.

    I notice you have 2010, I have 2007, shouldn't matter but who knows.

    Are you using a layout in your form? I'm using a Tabular layout.

    Thanks again
    Anj

    PS completely agree about the spaces, this is a client's database and it's rife with design don'ts.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I have both, 2007 here now.

    Layout? Oh no, I never use Layout. In fact, if I use a wizard to create form or report I immediately remove Layout because cannot do things like individually move or resize controls. That is the issue.
    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
    AnjJ is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    3
    Yep, that was the problem. Amazing how I've found no reference anywhere - forums, msdn, etc - to the fact that using a Layout will completely prevent the use of these methods and properties. Thank you!

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

Similar Threads

  1. move size method help
    By survivo01 in forum Forms
    Replies: 3
    Last Post: 10-22-2012, 11:09 PM
  2. Left join not working like usual
    By keyel1971 in forum Access
    Replies: 4
    Last Post: 05-29-2012, 10:12 AM
  3. Replies: 3
    Last Post: 12-15-2011, 09:26 PM
  4. Control properties for Menu Command
    By Pam Buckner in forum Access
    Replies: 1
    Last Post: 10-20-2011, 01:49 PM
  5. Relocating objects via "Left" properties value
    By Ripcut in forum Programming
    Replies: 0
    Last Post: 08-01-2008, 06:40 PM

Tags for this Thread

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