create a new module and past this code then call
RemoveAccessCaptionBar() in autoexec macro
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Option Compare Database
Option Explicit
' Store rectangle coordinates.
Type adhTypeRect
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type
Declare Function adh_apiGetWindowRect Lib "User32" Alias "GetWindowRect" (ByVal hWnd As Long, lpRect As adhTypeRect) As Long
Declare Function adh_apiGetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function adh_apiGetSystemMetrics Lib "User32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Declare Function adh_apiMoveWindow Lib "User32" Alias "MoveWindow" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Declare Function adh_apiSetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function adh_apiGetWindow Lib "User32" Alias "GetWindow" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
' GetWindowLong Constant
Public Const adhcGWL_STYLE = -16
' Windows Style constant
Public Const adhcWS_CAPTION = &HC00000
' System Metrics Constant
Public Const adhcSM_CYCAPTION = 4
Public Const adhcSM_CXFULLSCREEN = 16
Public Const adhcSM_CYFULLSCREEN = 17
Sub adhRemoveWindowCaptionBar(ByVal hWnd As Long)
Dim lngOldStyle As Long
Dim lngNewStyle As Long
Dim rct As adhTypeRect
Dim intDX As Integer, intDY As Integer
' Get the current window style of the form.
lngOldStyle = adh_apiGetWindowLong(hWnd, adhcGWL_STYLE)
' Turn off the bit that enables the caption.
lngNewStyle = lngOldStyle And Not adhcWS_CAPTION
' Set the new window style.
lngOldStyle = adh_apiSetWindowLong(hWnd, adhcGWL_STYLE, lngNewStyle)
' The caption's been removed, but now resize
' the whole window to match the size of the interior.
' Get the current size, including the caption.
adh_apiGetWindowRect hWnd, rct
' Calculate the new width and height.
intDX = rct.x2 - rct.x1
intDY = rct.y2 - rct.y1
' Move the window to the same left and top,
' but with new width and height.
' This will make the new form appear
' a little lower than the original.
Call adh_apiMoveWindow(hWnd, rct.x1, rct.y1, intDX, intDY, True)
End Sub
Public Function RemoveAccessCaptionBar()
Call adhRemoveWindowCaptionBar(Application.hWndAccessApp)
End Function