Results 1 to 8 of 8
  1. #1
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40

    Question text box location in form using VBA

    I have one text box with the name of nametxt and one it's label with name of namelabel. I want to relocate this text box with it's label when the button02 is clicked to the new location. Thus i have tried using this code:


    Code:
    Private Sub Command02_Click()
    nametxt.Top = 0.2083
    nametxt.Left = 1.0833
    namelabel.Top = 0.2083
    namelabel.Left = 0.5833
    End Sub
    But this code is not working correctly and relocate the text box to the up left corner of form. How fix this issue.
    I waiting for your help.
    thanks,

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    From help:

    In Visual Basic, use a numeric expression to set the value of this property. Values are expressed in twips
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40
    Please, Could you reply me how can i use this code in numeric expression system.

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Do some trial and error , start with 50 for both the top and left values of any one control and the adjust for other controls.

  5. #5
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40
    Please reply me the correct code not to I try, I am trying 3 days on this problem but their is no solve for this problem.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    The code is fine, but you have to use twips, not inches.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40
    Great., It's done. Thanks Mr. pbaldy.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 07-30-2013, 08:15 AM
  2. Replies: 5
    Last Post: 02-01-2013, 11:36 AM
  3. Dyanmic location for transfer text
    By shanmugamgsn in forum Access
    Replies: 5
    Last Post: 07-17-2012, 11:30 PM
  4. Replies: 4
    Last Post: 04-26-2012, 09:46 AM
  5. Access 2007 Form Image Location
    By trb5016 in forum Access
    Replies: 0
    Last Post: 07-08-2010, 08:04 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