sayın kenan827,
yeterli zaman olmaması nedeni ile görebildiğim kadarı ile kullandığınız iki modül içerisinde bir önceki mesajda bahsi geçen hususa dair düzeltme mevcut.
Module1 adlı modülün içeriğini
Kod:
Option Compare Database
Option Explicit
#If VBA7 Then
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare PtrSafe Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As LongPtr, _
ByVal nCmdShow As LongPtr) As LongPtr
#Else
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long
#End If
' This function is to be called as such:
' Call fSetAccessWindow (argument)
' The arguments are as follows;
' SW_HIDE - this hides the access database window
' SW_SHOWMAXIMIZED - this maximizes the window
' SW_SHOWMINIMIZED - this minimizes the window
' SW_SHOWNORMAL - this just shows (as normal) the window
Function fSetAccessWindow(nCmdShow As Long)
'Usage Examples
'Maximize window:
' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?fSetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?fSetAccessWindow(SW_HIDE)
'Normal window:
' ?fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " ") _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " ") _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)
End Function
kodları ile KOMPLE değiştiriniz.
basFunctions adlı modülün içeriğini de
Kod:
Option Compare Database
Option Explicit
#If VBA7 Then
Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As LongPtr) As LongPtr
Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON As LongPtr = 49
Private Const SM_CYSMICON As LongPtr = 50
Private Declare PtrSafe Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As LongPtr, ByVal lpsz As String, ByVal un1 As LongPtr, ByVal n1 As LongPtr, ByVal n2 As LongPtr, ByVal un2 As LongPtr) As LongPtr
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As LongPtr, ByVal wParam As LongPtr, LParam As Any) As LongPtr
'Global Referencing
Public Dte As Date
Public CRef As LongPtr
#Else
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON As Long = 49
Private Const SM_CYSMICON As Long = 50
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, LParam As Any) As Long
'Global Referencing
Public Dte As Date
Public CRef As Long
#End If
Public Function SetFormIcon(hWnd As Long, strIconPath As String) As Boolean
Dim lIcon As Long
Dim lResult As Long
Dim X As Long, Y As Long
X = GetSystemMetrics(SM_CXSMICON)
Y = GetSystemMetrics(SM_CYSMICON)
lIcon = LoadImage(0, strIconPath, 1, X, Y, LR_LOADFROMFILE)
lResult = SendMessage(hWnd, WM_SETICON, 0, ByVal lIcon)
End Function
Function IsLoaded(ByVal strFormName As String) As Boolean
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
kodları ile KOMPLE değiştiriniz.
inceleyebildiğim kadarı ile bunlar yeterli.fakat olursa da,bu örneklere bakarak diğerlerini düzeltebilirsiniz.
yinelemekte ve dikkatinizi tekrar çekmekte fayda var.
aşağıda bağlantısı yazılı konuyu incelemeniz tablo yapılandırmanıza dair faydalı olacaktır.sonraki zaman süreci içerisinde bu konuda yer alan hususlardan dolayı sorunlara maruz kalmanız muhtemeldir.
Konulara eklenen Uygulama içeriğine yönelik Tavsiyeler
bilginize...iyi çalışmalar,saygılar.