ich öffne von Excel aus ein Acc-Formular und möchte dann noch einen Wert in eine globale Variabel übergeben. Leider gelingt mir das mit der globalen Variabel nicht. Kann mir jemand einen Tipp geben? Schon mal Danke
Gruß Markus
Sub CallAccessMacro()
Dim accApp As Object
Dim sFile As String
sFile = "X:\tmp\Test.mdb"
If Dir(sFile) = "" Then
Beep
MsgBox "Access-Datenbank wurde nicht gefunden!"
Else
Set accApp = CreateObject("Access.Application")
With accApp
.OpenCurrentDatabase sFile
.DoCmd.OpenForm "frm_initialstatus"
.Visible = True
'Schreiben in eine globale Acc-Variable
'weiß leider nich wie
End With
Application.ActivateMicrosoftApp xlMicrosoftAccess
Set accApp = Nothing
End If
End Sub