Consulting

Results 1 to 2 of 2

Thread: Move Button on Outllook Form

  1. #1
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    5
    Location

    Move Button on Outllook Form

    Good Morning back again,

    Could someone suggest the way to move the location of a macro button. I have a button located on a form which is covering over a label and a text box which are not visible. Depending on which option is selected the label and text box become visible which means that I need to move the button down the form.

    The button is names "Submitbut" and I have tried Submitbut.Move 1134,13608,0,0 (This is on the principle that 1cm = 567 twips)

    I have tried other but the button just disappears.

    ------------------------
    Private Sub PermitTypeComboBox_Change()
    Dim YearPermitEndDate As Date
    Dim SixMonthPermitEndDate As Date
    'Dim EndYear As Date
    'Dim MidYear As Date
    
    
    'EndYear = "31/08/" & Year(Date)
    'MidYear = "31/03/" & Year(Date)
    
    
    'YearPermitEndDate = DateAdd("yyyy", 1, EndYear)
    'SixMonthPermitEndDate = DateAdd("yyyy", 1, MidYear)
    
    
    YearPermitEndDate = "31/08/2016"
    SixMonthPermitEndDate = "31/03/2016"
    
    
    
    
    If PermitTypeComboBox.Text = "Yearly Permit" Then
    PermitEndDateComboBox.Text = YearPermitEndDate
    PermitEndlbl.Visible = False
    PermitEndDateComboBox.Visible = False
    
    
    ElseIf PermitTypeComboBox.Text = "6 Month Permit" Then
    With PermitEndDateComboBox
    .AddItem SixMonthPermitEndDate
    .AddItem YearPermitEndDate
    End With
    PermitEndlbl.Visible = True
    PermitEndDateComboBox.Visible = True
    Submitbut.Move 1134, 13608, 0, 0
    
    
    End If
    End Sub
    ---------------------------

    Thank you

    Pjawynn
    Last edited by SamT; 06-21-2015 at 07:51 AM. Reason: Formatted code with # icon

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    For a form or control
    object.Move( [Left [, Top [, Width [, Height [, Layout]]]]])

    The Move method syntax has these parts:
    Part Description
    object Required. A valid object name.
    Left Optional. Single-precision value, in points, indicating the horizontal coordinate for the left edge of the object.
    Top Optional. Single-precision value, in points, that specifies the vertical coordinate for the top edge of the object.

    point

    A point is 1/72 inch. Font sizes are usually measured in points.


    Const OldSubmitTop as Single = nnn
    Const OldSubmitLeft As Single = nnn
    '
    '
    'Move to new Position
    Submitbut.Move(Top:=OldSubmitTop + 144, Left:=OldSubmitLeft + 90)
    '144 = 2", 90 = 1 1/4"
    
    'Move to original position
    Submitbut.Move(Top:=OldSubmitTop, Left:=OldSubmitLeft)
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •