Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
You can get rid of the title bar on a form by setting the BorderStyle to
None. Of course, your client will then complain that the form looks ugly
without a border (which it does). And that won't work for queries.
Experience has taught me to be very careful about saying 'it can't be done'
around here, but I'll be very surprised if it can be done with a query.
--
Brendan Reynolds
bren...@indigo.ie
mgat...@autometric.com wrote in message <7mvlnd$1go$1...@nnrp1.deja.com>...
Nirmala Sekhar
-----------------------------------------------------
Monthly newsletter on Microsoft Access at
http://www.saicomsystems.com/index.asp?id=tips
Fortnightly newsletter on motivational quotes
http://www.saicomsystems.com/index.asp?id=mind
******************************************************
Private Const GW_CHILD& = 5
Private Const GW_HWNDNEXT& = 2
Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
Private Const WS_BORDER& = &H800000
Private Const WS_CAPTION& = &HC00000
Private Const SW_MINIMIZE = 6
Private Const SW_NORMAL = 1
Private Declare Function GetWindow _
Lib "user32" (ByVal hWnd As Long, _
ByVal wCmd As Long) As Long
Private Declare Function GetClassName _
Lib "user32" Alias "GetClassNameA" _
(ByVal hWnd As Long, ByVal lpClassName As String, _
ByVal nMaxCount As Long) As Long
Private Declare Function GetWindowText _
Lib "user32" Alias "GetWindowTextA" _
(ByVal hWnd As Long, ByVal lpString As String, _
ByVal cch As Long) As Long
Private Declare Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function ShowWindow& Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As Long)
'
Function MDIHwnd() As Long
'Returns the window handle of the MDIClient
'Inputs none
'Depends on GetWindow, GetClassName API calls
Dim lngret As Long
Dim hWnd As Long
Dim lpClassName As String
Dim nMaxCount As Long
nMaxCount = 64
lpClassName = String(nMaxCount, 0)
hWnd = GetWindow(hWndAccessApp, GW_CHILD)
lngret = GetClassName(hWnd, lpClassName, nMaxCount)
lpClassName = Left(lpClassName, lngret)
Do Until lpClassName = "MDICLIENT" Or hWnd = 0
nMaxCount = 64
lpClassName = String(nMaxCount, 0)
hWnd = GetWindow(hWnd, GW_HWNDNEXT)
lngret = GetClassName(hWnd, lpClassName, nMaxCount)
lpClassName = Left(lpClassName, lngret)
Loop
MDIHwnd = hWnd
End Function
Function SetQueryBorderNone(QueryName As String) As Long
Dim hWnd As Long
Dim lpClassName As String
Dim nMaxCount As Long
Dim lpString As String
Dim cch As Long
Dim lngret As Long
Dim nIndex As Long
Dim dwNewLong As Long
hWnd = GetWindow(MDIHwnd, GW_CHILD)
Do
nMaxCount = 64
lpClassName = String(nMaxCount, 0)
lngret = GetClassName(hWnd, lpClassName, nMaxCount)
lpClassName = Left(lpClassName, lngret)
If lpClassName = "OQry" Then
cch = 256
lpString = String(cch, 0)
lngret = GetWindowText(hWnd, lpString, cch)
lpString = Trim(Left(lpString, InStr(lpString, ":") - 1))
If lpString = QueryName Then
lngret = hWnd
dwNewLong = GetWindowLong(hWnd, GWL_STYLE)
dwNewLong = dwNewLong And Not WS_BORDER
dwNewLong = dwNewLong And Not WS_CAPTION
Call SetWindowLong(hWnd, GWL_STYLE, dwNewLong)
Call ShowWindow(hWnd, SW_MINIMIZE)
Call ShowWindow(hWnd, SW_NORMAL)
Exit Do
Else
lngret = 0
End If
End If
hWnd = GetWindow(hWnd, GW_HWNDNEXT)
Loop Until hWnd = 0
SetQueryBorderNone = lngret
End Function
Nirmala Sekhar <n...@nowhere.com> wrote in message
news:3796cc63...@news.singnet.com.sg...
I will not say 'it can't be done' at comp.databases.ms-access
I will not say 'it can't be done' at comp.databases.ms-access
I will not say ...
--
Brendan Reynolds
bren...@indigo.ie
Terry Kreft wrote in message <7nhj5a$p0h$5...@gate.mps.co.uk>...
>Brendan,
>Now remember you made me do this <g>.
>
>Private Const GW_CHILD& = 5
<snip>
>> On Mon, 19 Jul 1999 18:45:58 +0100, "Brendan Reynolds"
>> <bren...@indigo.ie> wrote:
<snip>
>> >Experience has taught me to be very careful about saying 'it can't be
>done'
>> >around here, but I'll be very surprised if it can be done with a query.
<snip>
>> >mgat...@autometric.com wrote in message
<7mvlnd$1go$1...@nnrp1.deja.com>...
>> >>Is it possible to hide the Title Bar in Access 97? My client is
>> >>bothered by the blue bars appearing in forms, queries, etc.
<snip>