Results 1 to 5 of 5
  1. #1
    lawdy is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    172

    How to find and set position of controls using code


    I am unable to find or set the position of controls using code. I would like to push a button and place some text objects on a form. I have not been abl to find any code for this. Is there any code for this?

  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,902
    Yes. Here is an example of setting Top, Left, Width properties of textbox:

    Me.tbxTMA.Top = 4979.952 'in twips, 1 inch = 1440 twips

    Me.tbxBox1.Left = 0.25 'in inches

    Me.tbxBox1.Width = 11520 'in twips, 1 inch = 1440 twips
    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
    lawdy is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    172
    Ok, that works good. Now if I have 10 boxes, and click the mouse inside one, Is there a way to determine which on I clicked in?

  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,902
    Try like:

    Private Sub UmpID_Click()
    Debug.Print ActiveControl.Name
    End Sub

    Why would you need this?
    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
    lawdy is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    172
    I don't need it. I was having a brain freeze moment. Thank you.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-04-2013, 12:07 PM
  2. Replies: 1
    Last Post: 06-22-2012, 03:33 PM
  3. Replies: 2
    Last Post: 03-02-2012, 09:17 AM
  4. Find primary key name by code
    By MichaelS in forum Access
    Replies: 2
    Last Post: 09-22-2011, 07:09 AM
  5. Replies: 8
    Last Post: 01-21-2011, 03:36 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