S
stephan querengässer
hello ng,
i have developed an addin, which contains different functions to modify
access-dbs. these function should be provided in all databases >>menu-addin.
when i start the addin, i call a function which creates a temporary
menu-bar. form these buttons i want to invoke my function.
if i test it in the addin-mdb it works fine. but if i install it as a addin,
it appears a error, that access couldn't find the function which i defined
in the onAction-property of the menu-button. if i invoke my functions
directly in start-procedureof the addin without menu-buttons it works fine
too.
i tried this with ONAction-property:
"=frmSelectTrim"
"=frmSelectTrim()"
"frmSelectTrim"
"frmSelectTrim()"
i tried also to specify the module which contains my functionslike this:
"=[edit].[frmSelectTrim()]"
i'm in state of confusion and need your help.
thx and best regards
/sq
system: xp pro, ms access 2k
code:
Sub start()
Dim BLeiste As CommandBar, BLStElem As CommandBarControl
Dim PpStElem As CommandBarPopup, BLUStElem As CommandBarControl
On Error GoTo HinzufügenNeueMB_Err
' Erstellt eine neue Menüleiste und verankert sie zur Linken.
Set BLeiste = CommandBars.Add(name:="MResultAccessModule", Position:= _
msoBarTop, MenuBar:=False, Temporary:=True)
' Macht die Menüleiste sichtbar.
BLeiste.Visible = True
' Hindert die Benutzer am Verschieben der Menüleiste.
'BLeiste.Protection = msoBarNoMove
' Erstellt ein Popup-Steuerelement auf der Menüleiste und beschriftet es.
Set BLStElem = BLeiste.Controls.Add(Type:=msoControlPopup)
BLStElem.Caption = "Editieren"
' Erstellt zwei Steuerelemente für das Popup-Steuerelement und setzt einige
Eigenschaften.
Set BLUStElem = BLStElem.Controls.Add(Type:=msoControlButton)
With BLUStElem
..Style = msoButtonIconAndCaption
..Caption = "Tel.-Nr. editieren"
..FaceId = 568
..OnAction = "=editTelNumbers()"
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<INVOKE FUNCTION, HERE IS THE
PROBLEM
..Parameter = 1
..BeginGroup = True
End With
Set BLUStElem = BLStElem.Controls.Add(Type:=msoControlButton)
With BLUStElem
..Style = msoButtonIconAndCaption
..Caption = "nicht belegt"
..FaceId = 276
..OnAction = "=MsgBox(""to be continued..."")"
..Parameter = 2
..BeginGroup = True
End With
Exit Sub
HinzufügenNeueMB_Err:
MsgBox "Fehler " & Err.Number & vbCr & Err.Description & vbCr & "Menüleiste
schon vorhanden, bitte einblenden!", vbInformation, "Hinweis:"
Exit Sub
End Sub
Public Function editTelNumbers()
Dim rs As DAO.Recordset
Dim db As DAO.Database
.....
MsgBox rs.RecordCount & " Datensätze bearbeitet.", vbOKOnly, "Hinweis:"
End Function
i have developed an addin, which contains different functions to modify
access-dbs. these function should be provided in all databases >>menu-addin.
when i start the addin, i call a function which creates a temporary
menu-bar. form these buttons i want to invoke my function.
if i test it in the addin-mdb it works fine. but if i install it as a addin,
it appears a error, that access couldn't find the function which i defined
in the onAction-property of the menu-button. if i invoke my functions
directly in start-procedureof the addin without menu-buttons it works fine
too.
i tried this with ONAction-property:
"=frmSelectTrim"
"=frmSelectTrim()"
"frmSelectTrim"
"frmSelectTrim()"
i tried also to specify the module which contains my functionslike this:
"=[edit].[frmSelectTrim()]"
i'm in state of confusion and need your help.
thx and best regards
/sq
system: xp pro, ms access 2k
code:
Sub start()
Dim BLeiste As CommandBar, BLStElem As CommandBarControl
Dim PpStElem As CommandBarPopup, BLUStElem As CommandBarControl
On Error GoTo HinzufügenNeueMB_Err
' Erstellt eine neue Menüleiste und verankert sie zur Linken.
Set BLeiste = CommandBars.Add(name:="MResultAccessModule", Position:= _
msoBarTop, MenuBar:=False, Temporary:=True)
' Macht die Menüleiste sichtbar.
BLeiste.Visible = True
' Hindert die Benutzer am Verschieben der Menüleiste.
'BLeiste.Protection = msoBarNoMove
' Erstellt ein Popup-Steuerelement auf der Menüleiste und beschriftet es.
Set BLStElem = BLeiste.Controls.Add(Type:=msoControlPopup)
BLStElem.Caption = "Editieren"
' Erstellt zwei Steuerelemente für das Popup-Steuerelement und setzt einige
Eigenschaften.
Set BLUStElem = BLStElem.Controls.Add(Type:=msoControlButton)
With BLUStElem
..Style = msoButtonIconAndCaption
..Caption = "Tel.-Nr. editieren"
..FaceId = 568
..OnAction = "=editTelNumbers()"
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<INVOKE FUNCTION, HERE IS THE
PROBLEM
..Parameter = 1
..BeginGroup = True
End With
Set BLUStElem = BLStElem.Controls.Add(Type:=msoControlButton)
With BLUStElem
..Style = msoButtonIconAndCaption
..Caption = "nicht belegt"
..FaceId = 276
..OnAction = "=MsgBox(""to be continued..."")"
..Parameter = 2
..BeginGroup = True
End With
Exit Sub
HinzufügenNeueMB_Err:
MsgBox "Fehler " & Err.Number & vbCr & Err.Description & vbCr & "Menüleiste
schon vorhanden, bitte einblenden!", vbInformation, "Hinweis:"
Exit Sub
End Sub
Public Function editTelNumbers()
Dim rs As DAO.Recordset
Dim db As DAO.Database
.....
MsgBox rs.RecordCount & " Datensätze bearbeitet.", vbOKOnly, "Hinweis:"
End Function