Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Sizing Form (2003 / 2000)

    How do I eliminate the vertical space between the dividing line at the bottom of a form and the Navigation Buttons?

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

    Re: Sizing Form (2003 / 2000)

    Does your form has a form footer? If so, reduce its height as much as possible - to 0 if there are no controls in the footer.
    If the Auto Resize property of the form has been set to Yes, the form will automatically size itself when it is opened; if this property has been set to No, the form will have the size it had when you last saved it, which may not be optimal.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sizing Form (2003 / 2000)

    Hi Hans,

    Thanks, I had Auto Rsize off.

    Nother question: What would be your recommended method (i.e. code) for an action button on a form that deletes the current record?

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

    Re: Sizing Form (2003 / 2000)

    Let's say you have a command button cmdDelete. The On Click code for this button could look like this:
    <code>
    Private Sub cmdDelete_Click()
    On Error GoTo ErrHandler
    ' Ask for confirmation
    If MsgBox("The current record will be deleted." & vbCrLf & "Are you sure?", _
    vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
    ' Suppress warnings
    DoCmd.SetWarnings False
    ' Delete current record
    RunCommand acCmdDeleteRecord
    End If

    ExitHandler:
    ' Re-enable warnings
    DoCmd.SetWarnings True
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub
    </code>
    You can add a check at the beginning to exit the procedure if the primary key is null, and other bells and whistles, if desired.

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sizing Form (2003 / 2000)

    Thanks Hans,

    That's a much better scheme than the one built-in to Access.

Posting Permissions

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