Modules & VBA :: Can Manually Stop Auto-Exec Macro From Running By Holding Down Shift Button
Dec 22, 2014
I can manually stop the AutoExec macro from running by holding down the shift button - how do you do it by VBA? I'm opening the db from Excel, and I don't want the Switchboard to display ...
View Replies
ADVERTISEMENT
Aug 19, 2013
I bring up the database (Access 2003 / XP) by holding down the shift-key. As designed, the shift-key by-passes running the autoexec macro automatically. I then run the autoexec macro with the vba code viewer up so I can F8 down through all the code. The autoexec macro is one statement - RUNCODE which executes a vba FUNCTION Startup(). Everything seems to work great, but when the function goes to EXIT FUNCTION I assumed it's completed. BUT the next F8 GOES TO THE Startup() FUNCTION again and runs through the code over and over.
I don't think it does this when the program actually runs normally (don't by-pass the autoexec), but why it's running the function over and over again when I'm F8'ing through the code.
Is it something peculiar with the AUTOEXEC in MS ACCESS? Can I trust that it really does ONLY RUN ONE TIME?
View 2 Replies
View Related
Jul 29, 2007
Hello,
Believe it or not, we just upgraded from Access 2000 to 2003. In Access 2000, I have my dbs set up so that you must hold the shift key down while opening the db in order to see the database window. In 2003, holding down the shift key isn't working. Is there another way to get the database window open (or am I doing something terribly wrong)?
Thanks in advance.
View 1 Replies
View Related
Oct 16, 2013
Normally when I hold down the shift key when opening an Access database it opens in development mode. When I do this on a certain database it does not. It still opens in program mode. If I hit F11 it goes into a sort of development mode but I do not get the ribbon bar at the top etc.
Has something been set on this database to stop it opening in development mode? Can I switch it off?
View 2 Replies
View Related
Jul 13, 2014
I need to stop already ran procedure or function with vba code . So I use END command ans everything stops.. in some cases that is useful, but some times need I to do something else after I use END command, but after END everything stops...
LIKE THIS :
SUB ()
END
ME.CTL.SETFOCUS
'OR
CALL function
EXIT SUB
View 5 Replies
View Related
Jul 16, 2015
I completed the Op[en form and find specific data wizard and it works.
Here is my issue: If there is no data to find, I get a "Stop Macro" error.
How to change this?
View 1 Replies
View Related
Jan 8, 2013
I am making my very first tentative steps to convert my most complex Access 2003 app to run under Access 2007. There are no obvious problems when simply opening my original MDB file in Access 2007 or running it after conversion to an ACCDB file. However, when I try to run the ACCDB file under the Access 2007 Runtime I get a "You can't carry out this action at the present time..." error. This is then followed by the "Execution of this application has stopped due to a runtime error..."
To be more specific, I only get that error when I deliberately hide the back end database and thus invoke code triggered via Autoexec to allow the user to browse for the missing database. This code works fine when running under normal Access 2007 so it appears to be a Runtime issue.
View 3 Replies
View Related
Jan 31, 2014
I have 2 forms and a macro in Form1 which runs throught every record to update the records, however.I would like to run this macro from the main form (Form2)
I have tried
docmd.openform "Form1"
Run Macro
but it doesnt work
View 4 Replies
View Related
Feb 19, 2014
I have a DB with an AutoExec macro. I created the DB from scratch. When I open the DB from Windows Explorer with the shift key held down the AutoExec macro still runs. If I have people on other computers open the same way it doesn't run. If I open Access first then hold the shift key down it doesn't run. I couldn't find any references to a shift key issue like this. I'm looking for an answer as to why there would be a difference on my PC between opening in WE or directly in Access.
View 3 Replies
View Related
Jul 6, 2007
Hi all. Can't seem to find a similar thread although I'm sure there must be one.
I have a macro that runs update queries when exiting the database. What I'd like to do is display a message whilst the updates are running. However, I only seem to halt the macro until the user clicks the ok button on the message box.
Any ideas?
Cheers
View 1 Replies
View Related
Sep 30, 2013
Is it possible to have a macro button to pass query results to a listbox? I have a database where I have some fields with dates. What I need to do is to show a list of all cases that have a start date (and also the end date). So I will have 2 buttons, one that says "show started cases" and second one "show closed cases". If I press the first button, it will run a query and show only those cases that have a date filled in the started case field. I made a button that shows the results in a report, but I would like to have it show up in a listbox so I can double click it and go straight to the case.
View 14 Replies
View Related
Mar 27, 2006
I have a form that sets criteria in a series of make-table queries that go on to power a report. I've set up a macro to first open the form and then run the make-table queries and then open the final report. My trouble is that before I can set the criteria in the form I'm getting prompted by the make-table queries.
How can I stop the macro so I can input data and then re-start it? I tried using a stop macro command but that didn't work out for me.
Thanks
View 5 Replies
View Related
Nov 1, 2006
I am basically setting up a macro that will change the value for a field from "N" to "Y" for all records from a query. The macro works fine except for it does not know when to stop and gives an error message of "You can't assign a value to this object" after it has gone through all of the records and there are none left to change. The macro is set up like this:
OpenForm Action : This form is populated by the query and I set the Where condition to open records that don't already have a value of "Y".
SetValue Action : I use this to set the value of the field to "Y"
Close Action : I use this to close the form and save the changes
RunMacro Action : This is where the problem is. I use this to repeat the macro so it can go through the rest of the records that still have the field set to "N". I need to set the Condition or Repeat Expression so that it checks if all of the records have been changed. It either needs to check that all records have the field = "Y" or check that the macro is on the last record. Basically something that will cause the macro to not open itself again when there are no more records to be changed.
View 2 Replies
View Related
Dec 4, 2012
I have a macro that opens up a form called SLA Complete Form - The macro then goes and examines two fields on the form to see if they contain data and if they do not then it displays a popup box with a message.
The form that gets opened up can have anywhere from one record to approximately a hundred records.
How can I get the macro to stop running when it hits the last record on the form without displaying an error message. I am currently using the next record feature in the macro.
View 1 Replies
View Related
Nov 29, 2006
Ok - really need some help here. I have searched and searched but i think my problem is slightly different to the ones i am finding.
Basically i have a form and i want to force users to fill in one out of 4 tick boxes. If none of them are ticked when they press the close button i want the form to stay open and a message box come up.
I can get the message box part to work but the form still closes down.
The reason for this is that when the form closes it goes to another form that is linked to it by a unique ID number. This works by the following code.
Private Sub BTN_INVIS_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm closure"
stLinkCriteria = "[issue ID]=" & Me![Issue ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BTN_INVIS_Click:
Exit Sub
Err_BTN_INVIS_Click:
MsgBox Err.Description
Resume Exit_BTN_INVIS_Click
End Sub
What i have tried to do is insert a piece of code into the above to generate the message box so it now looks as follows:
Private Sub BTN_INVIS_Click()
If [Transport_Delivery_issue_] = False And [Process_issue_] = False And [Design_issue_] = False And [Supplier_issue_] = False Then
MsgBox "You must complete the liability box before you can close this issue"
Cancel = True
[Design_issue_].SetFocus
End If
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm closure"
stLinkCriteria = "[issue ID]=" & Me![Issue ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BTN_INVIS_Click:
Exit Sub
Err_BTN_INVIS_Click:
MsgBox Err.Description
Resume Exit_BTN_INVIS_Click
End Sub
This code checks the boxes and generates the message box if none are ticked - that works great. However it doesnt stop the second part of the code (the move to the next form) from executing if the boxes arent ticked.
Would really appreciate it if someone could help me - i'm fairly new to coding so the whole database is a bit cobbled together (mostly with help from this forum!).
View 3 Replies
View Related
Jan 14, 2014
I have a form with tab set one tab called "Enter Receipt" and another that houses 2 queries called "Reconcile". My issue is when I open that form, I have an On Current Macro to go to NEW record for my Enter Receipt, but I am getting a delay while the query status bar runs the other queries. I was hoping not to have those ran until i enter the parameters and hit the run button on that "reconcile tab".
Everything else works, i just need the queries to keep from running when i load the form. my queries i moved from EDITED to NO LOCKS thinking the On Current new record may affected them, not change in delay.
View 3 Replies
View Related
Apr 27, 2006
Hi, in some application I have made using a switchboard after starting up, I saw that when the user holds the shift button, this switchboard does not show up automatically. How can i fix it that the user cannot interfere holding this button?
View 2 Replies
View Related
Oct 17, 2013
i've got a data entry form. when i click the button add all the other buttons go grey, i am in mode "New" also i am able to add, edit, records in this state, when i press save i want the supplierID field to automatically populate itself with the next SupplierID record THAT IS EMPTY. So say that my last record was ID number 45 then when i click add on my form and go into "New" state the SupplierID field automatically populates itself with "46" btw this is all an unbound form,
View 7 Replies
View Related
Jul 1, 2015
Code:
ExportWindow = FindWindow(vbNullString, "Output To")
OkButtonTest = FindWindowEx(ExportWindow, ByVal 0&, "DUIViewWndClassName", vbNullString)
ButtonOKTest = FindWindowEx(ExportWindow, ByVal 0&, "Button", "OK")
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
The above code works and my issue is how can I move the mouse to the OK button and click on it to. The reason why is when I SETTEXT to the address bar it does not refresh so I SETTEXT to the file name box to navigate to the prescribe address which will refresh the navigation bar once the OK button is clicked. How to refreshing the navigation bar.
View 2 Replies
View Related
Mar 11, 2008
Hi,
Can I use a macro to run multiple queries in sequence?
I searched on this but did not see anything that indicated how to do this.
Any pointers would be appreciated!
Thanks,
Mark
View 1 Replies
View Related
May 16, 2006
I've got a Macro that runs well over 100 queries as well as sub-macros. I'd like to know what query the Macro is running. My best solution so far was to create a bunch of forms that open and close with the name of each query, but that's kind of sloppy. I don't think I can use the msgbox because it prompts me to press 'OK' to continue. Any thoughts?
View 2 Replies
View Related
Jun 14, 2004
Hi all,
I was hoping that someone could tell me if it is possible to run an Excel macro from an Access database. I am importing 3 Excel worksheets into Access and this macro needs to be run on all 3 evertime that this file is imported by the user (twice a week). If this can be done could someone please tell me how ??
View 14 Replies
View Related
Nov 15, 2006
hey there,
i have a macro that has 2 actions:
set warnings to warning on: NO
and
runCode to Function Name: cmdImport_Click()
where cmdImport_Click() is a Private Sub in a module within the same database.
when i try to run the macro i get an error that stated
"the expression you entered has a function name that MS Access can't find."
but if i open the module called ImportMSExcelFile and set my cursor on the Private Sub cmdImport_Click() and select the green arrow to run the procedure it runs fine.
any suggetions?
tuktuk
View 2 Replies
View Related
Aug 25, 2012
I have a MS Access append query that updates a table from a linked Excel spreadsheet. Im trying to automate the running of the query during the night.
Ive tried a couple of ways to schedule the task with Windows Task Scheduler, although each time, it appears to start the job, but then just hang (task never completes, doesnt run the query or macro and when I log back into Windows, the msaccess.exe process is running).
Methods Ive used are:
- command line with /x macroname
- vbs script which runs the query / macro
Code:
'Read from a Microsoft ACCESS database
Option Explicit
dim oaccess
'execute another Access macro
set oaccess = createobject("access.application")
oaccess.opencurrentdatabase "H:Database.mdb"
oaccess.docmd.setwarnings false
oaccess.DoCmd.RunMacro "Macro1"
oaccess.docmd.setwarnings true
oaccess.closecurrentdatabase
oaccess.quit
set oaccess=nothing
WScript.Quit(0)
- .bat file which just has the command line in it.They all run fine when I am logged in, although it seems to hang when I am logged off the network. I have the correct permissions as Ive scheduled a Excel macro to run and its fine.
View 4 Replies
View Related
Jan 1, 2015
I have 3 different "buttons" on my form that run individual update queries. I know these update queries are running correctly. Decided to make a macro that will allow me to run all these queries by clicking one macro button.
My question is: Is there some way to stop the pop up msg that advises I am about to run an update query and the next pop up msg that informs me of how many rows I am going to update?
These pop up boxes are starting to drive me crazy when I run the macro.
View 5 Replies
View Related
Dec 8, 2013
I am trying to write a more complex macro that will start another macro at a preset time, however I am getting stopped at the first hurdle - getting a macro to run another macro.
Here is the code i am using at the moment, all I want to do currently is click the first button, then get the second macro to execute. But no luck, getting error 2157 "cannot find the procedure"
Code:
Private Sub Command3_Click()
MsgBox "1st macro running", vbExclamation, "Note"
Application.Run "teststart1"
' Application.OnTime TimeValue("19:55:00"), "teststart1"
[code]....
View 1 Replies
View Related