I´m working with the source code (the .accdb file) of a previously developed Access 2010 project in order to make some changes and modifications required by the users, and I'm having certain problems when I try to run it (from the source code) and try to debug the flow of execution through the modules ot the system.
I noticed that VBA Access code doesn´t keep the breakpoints I set when I save the project, just like Visual Basic 6.0 (or NET, I don´t remember well) used to do. So, I have to load the database again holding the shift key, which now I know overrides the execution of the initial autoexec macro and the loading of a customized options ribbon. This is the only way I can interact with VBA code as a programmer, as far as I have seen until now.
I added a "Stop" command to a couple of modules in the code, trying to simulate a breakpoint at runtime (still in the source file) but only works the first one i set, in one of the modules executed by the autoexec macro and not a second one, that I set in the procedure fired when the user selects an option in the customized ribbon and the "onAction" XML tag triggers. This module is outside the range of the autoexec macro; this is the only "particular" point I notice.
Is there another way to run the entire system via the .accdb file, without having to use the shift key ? (starting, as stablished, with the autoexec macro)
I'm sending a copy of the code thats is not working. The previous Msgbox before the 'Stop' runs well, so I don´t know why the following 'Stop' fails (just doesn't pause the execution). I´d really appreciate your help.
Here´s the code:
Sub OnActionTglButton(control As IRibbonControl, pressed As Boolean)
' Callbackname in XML File "onAction"
' Callback for a Toggle Buttons click event
MsgBox "Quitar éste mensaje", vbCritical, "basRibbonCallbacks"
Stop
Select Case control.Id
Case "tgbclientes"
' In Tab: tabclientes
' In Group: grpclientes
parms(6) = min_pedido()
If parametro(125) = 1 Then
DoCmd.RunSQL ("UPDATE dbo_restricciones SET formulario='f_clientes' " & _
"WHERE programa_id=9")
Else
DoCmd.RunSQL ("UPDATE dbo_restricciones SET formulario='f_clientes_america' " & _
"WHERE programa_id=9")
End If
......... continues
What I have tried:
I'm trying to isolate the problem, maybe the open mode of the database in Access has something to do with this.
If I:
1.- Double click the source dataBase (.accdb) via Windows Explorer:
- It does hide the default menus and load the customatized Ribbon. Does not execute the 'Stops' commands.
2.- Enter Access- double click the source database in what they call the backstage of the list of files:
- It does hide the default menus and load the customatized Ribbon. Does not execute the 'Stops' commands.
3.- Enter Access - Click option "open" - Select the DB in the Open file dialog:
- It does hide the default menus and load the customatized Ribbon. Does not execute the 'Stops' commands.
4.- Enter Access - Load the DB while holding the <shift> key- Execute the autoexec macro directly or step by step:
- Does NOT load the customized ribbon and does not hide the default menus - The first 'Stop' statements works fine - the second 'Stop' statement just does not pause the execution of the code; that´s what I really need to achieve, in order to see the following code to be executed, when the user selects an option in the customized ribbon.