ACC2002: Microsoft Access Project Form Displays #Name? in Print Preview (293148)
The information in this article applies to:
This article was previously published under Q293148 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
When you view an Access project form that has a Server Filter applied to it in print preview, the form loses its connection to its record source and #Name is displayed in all of the data controls.
CAUSE
This problem occurs when the Min and Max buttons of the form are disabled.
RESOLUTION
The best solution is to leave the MinMaxButton property of the form set to Both Enabled, and then to use the following code in the OnOpen event procedure of the form to hide the Min and Max buttons.
First, add the following application programming interface (API) declaration to any module in the database.
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Const WS_MINIMIZEBOX = &H20000
Public Const WS_MAXIMIZEBOX = &H10000
Public Const GWL_STYLE = (-16)
Then add the following code to the OnOpen event procedure of the form to automatically hide the Min and Max buttons when the form is opened.
Private Sub Form_Load()
SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, _
GWL_STYLE) And Not (WS_MAXIMIZEBOX Or WS_MINIMIZEBOX)
End Sub
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 11/6/2003 |
---|
Keywords: | kbbug kbnofix KB293148 |
---|
|