Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Repositioning a tab control (Access 2003 SP2)

    I have a form on which I want to enter several dates into text boxes in various places. I'm using a tab control which contains a calendar control & 2 command buttons. Beside each date text box is a command box which makes the tab control visible & repositions so that the user can enter the date.

    However the tab control comes out the wrong size, as per the code below :

    With Me!tbcCalendar
    .Top = mctlCalRef.Top
    .Height = 5.5 * gcintTwipsPerCm
    .Left = mctlCalRef.Left + mctlCalRef.Width + (0.5 * gcintTwipsPerCm)
    .Width = 6.6 * gcintTwipsPerCm
    .Visible = True
    Debug.Print "tbcCalendar Left = " & Format(.Left / gcintTwipsPerCm, "0.00")
    Debug.Print "tbcCalendar Top = " & Format(.Top / gcintTwipsPerCm, "0.00")
    Debug.Print "tbcCalendar Height = " & Format(.Height / gcintTwipsPerCm, "0.00")
    Debug.Print "tbcCalendar Width = " & Format(.Width / gcintTwipsPerCm, "0.00")
    End With

    This generates the following (using gcintTwipsPerCm = 567):

    tbcCalendar Left = 3.97
    tbcCalendar Top = 1.11
    tbcCalendar Height = 7.72
    tbcCalendar Width = 6.60

    How come the height is 7.72 when I set it to 5.5, and the Left value is wrong as well.

    Any thoughts on this one ?

    Your usual expert help is as always appreciated

    Nick

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repositioning a tab control (Access 2003 SP2)

    I haven't tested this, but in my experience, tab controls behave strangely, They tend to shift if you push the controls on a tab page near the left or top edge. And the Height may well be the height of a tab page. It's probably best to adjust the numbers by trial and error until they're about right.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repositioning a tab control (Access 2003 SP2)

    Thanks for that Hans

    It seems as though the command buttons were remaining 'fixed' at the bottom of the tab control & so messing up the Height value. I rethought the form & repositioned the individual controls instead - easier in the long run.

    Nick

Posting Permissions

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