[VB] Ouverture d'une base Access par le code
J'ai récupérer dans la FAQ un code de Morsi permettant d'ouvrir une base de données
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Function fOpenRemoteForm(strMDB As String, _
strForm As String, _
Optional intView As Variant) _
As Boolean
Dim objAccess As Access.Application
Dim lngRet As Long
On Error GoTo fOpenRemoteForm_Err
If IsMissing(intView) Then intView = acViewNormal
If Len(Dir(strMDB)) > 0 Then
Set objAccess = New Access.Application
With objAccess
lngRet = apiSetForegroundWindow(.hWndAccessApp)
lngRet = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)
'le premier appel à ShowWindow semble rester sans effet
lngRet = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)
.OpenCurrentDatabase strMDB
.DoCmd.OpenForm strForm, intView
Do While Len(.CurrentDb.Name) > 0
DoEvents
Loop
End With
End If
..... |
mais j'ai une erreur de type reference incorrecte au niveau des lignes
Code:
"lngRet = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)"
y a t'il une reference que je doit ajouter, ou autre chose?
merci d'avance,
Jouf