473,287 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Microsoft Access Run-time Timer Event No Firing

DJRhino1175
221 128KB
I'm running the following code in the timer event section when my database opens. It works on the my Office 365 version, but doesn't seem to fire on the run-time version of access. My database is on a network in a FE/BE setup. There is a yes/No box in my table called "ztblSystemStatus". When I uncheck this box and close out the timer should run out and this code should run and close out the front end's that I have out on the manufacturing floor which use access run-time. I have let it sit for over 5 mins on a 1 minute timer(60000 milliseconds). When it works correctly it pops up a popup form with a message that the database is going down for maintenance in 10 secs....but nothing happens. I open mine and sure enough after 1 minute the message pops up and then closes 10 secs. later. Any idea on how I can get runtime to work with this setp?


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.  
  3. 'Checks system status
  4. Dim varRetVal
  5.     varRetVal = DLookup("SystemUP", "ztblSystemStatus")
  6.     If Nz(varRetVal, 0) = 0 Then
  7.         DoCmd.OpenForm "frmSystemExit", acNormal
  8.     End If
  9.  
  10. End Sub
Jan 27 '23 #1

✓ answered by NeoPa

As a quick addition to that DJ, what I do is to design a Form that works as both a Startup one and a permanent one (One that closes when, and only when, the database itself closes.) and when you no longer want the Startup part to show then simply hide it rather than close it. That way all your clever stuff that needs to be available all the time is always open when your project is running.

I also have code in my main (Startup) form that repeatedly checks for a message telling it to close down (for the allowance of maintenance tasks).

13 13327
NeoPa
32,554 Expert Mod 16PB
Hi DJ.

I suspect this is an issue with code running at all in the environment where it's failing. I suggest you do some tests on those PCs and see if you can get some simpler code to run and show you it is. MsgBox() is good for such things.

Things to consider when code doesn't run are :
AV software.
Access security settings.
Code Signature status of project.
Location of project file (ACCD(B/E) or MD(B/E)) (Safe Locations).

Once you've figured out whether code even runs or not, then you can worry about the actual code you want to use.
Jan 28 '23 #2
DJRhino1175
221 128KB
This works on all Office 365 Access installs except for the runtime . All front ends are in the same location weather they are runtime or not. All other codes I have work just fine. Its only this timer event that doesn't work with runtime. Not sure about security settings for runtime as there isn't a ribbon or anyway for me to go into security settings, at least that I know of.
Jan 30 '23 #3
NeoPa
32,554 Expert Mod 16PB
Hi DJ.

If you report on what tests you did and the results of those tests in the different environments then we will have a clearer understanding of what's what and I can know you actually ran tests rather than remember from before. It takes work. I will need properly explained tests and results rather than you just jotting down a couple of ideas.

How did you check for AV?
What did you do to test that other code runs using the runtime? Does a basic MsgBox() call work from a simple Timer event (Simple == Form design rather than turning on the timer using code). That is not an exhaustive list but just some illustrative examples. See earlier post for items that need to be dealt with.

PS. No promises (except to try for you). This wouldn't be here if it were a simple problem.
Feb 1 '23 #4
DJRhino1175
221 128KB
I have a timer event on the form that is 120,000 milliseconds. The code above checks in a table whether "systemUp" yes/no Box is checked or not. If its checked the system is up and running(Not in maintenance mode). If the box is unchecked then it triggers the above code. This code then triggers a pop up form that has a 10 second timer on it which then quits access. So what I have done to test this is uncheck the box in the table while my front end is open and waited till it closed down. This works perfectly for me and anyone else with a full version of access. All front ends are located in the same folder of a network drive. All front ends are made from a copy of my front end and renamed. All the front ends that are used out on the production floor are opened with Access Runtime installed. These are the ones that will not close out as they should. Everyone that access that folder has the same rights to the database. I'm just not sure why this would work on the full version of access but not runtime, because in theory it should as runtime only has the design elements stripped from it.

Thanks Neo for your help. Hopefully I explained it better.
Feb 1 '23 #5
NeoPa
32,554 Expert Mod 16PB
DJRino:
Hopefully I explained it better.
It was never about failing to understand your situation DJ. Possibly the reverse from what I see. I'm trying to make it clear what you need to do (with my help where I can) in order to discover what your problem is.

I understand the logic of what you're trying to do. And, it should be added, are succeeding in doing under some circumstances. This doesn't take us forward at all though. I tried to explain a bit in my other posts but it seems we're a little at cross-purposes here. Rather than worrying about the logic of your code - which from what we know so far is probably quite adequate - we need to look elsewhere and try to discover exactly what is different where in the environments that don't work as expected.

For this we need to look at running some exclusion tests. If you are still interested (I know this won't be simple work, and it's more involved due to explaining by the written word rather than using more immediately interactive methods, so you may choose not to get involved).

When testing out concepts it's important to simplify as much as humanly possible. EG. Does code run at all in the environment being tested? Create a separate database just for testing and get it to run as simple a bit of code as possible. Testing code you know runs elsewhere is simply not good enough. There are 1,000,001 different reasons why that particular code may have problems in the environment. So, to avoid even having to think about whether or not a test is worthwhile with existing code, we always strip to the very basics.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     Call MsgBox("Test")
  3. End Sub
For a Timer event you may want something that changes between firing so you can see it's ongoing. For instance have a Label control on the Form with code of the form :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.     Static lngX As Long
  3.  
  4.     lngX = lngX + 1
  5.     Me.lblX.Caption = lngX
  6. End Sub
Only when you know what is causing the issue can you consider the best way to correct it. As I said before - ensure the Timer is working by design and not reliant on code to trigger it.

Now, please refer back to earlier posts for required information. I still have nothing from you relating to AV software. It would also be helpful to know how a workstation that gets upgraded to full Access (rather than RunTime), without any other changes, behaves. It should be ok to return it to RunTime once we no longer need info from it.

I will certainly understand if you choose not to take this route, but I see no other way to garner the info you require. Certainly this situation is not one I've dealt with before.
Feb 1 '23 #6
DJRhino1175
221 128KB
Neo,

I'll try what you asking. with a blank Database with the codes you listed.

AV software is, to me at lest, looks like they are just running windows security.

Due to a cost cut, they uninstalled 365 from most of the accounts and installed free versions of Word and excel. I had them install Access Runtime as only developers needed the full version to create databases.

The database were are running is a .accdb and not what ever extension it is for run time...Hope that helps a little more. In the mean time I will try and make a basic database and use the code provided and report on my findings.

Thanks,

DJ
Feb 1 '23 #7
NeoPa
32,554 Expert Mod 16PB
If your technical people (who install the software) don't mind the extra work you give them then please ask them to install the full version of Access (temporarily) onto one of the PCs only, as a test workstation. It needn't be licensed as short-term testing doesn't require one as far as I understand (I'm not a licensing expert but I am an Access MVP so have what I believe is a decent understanding of such things). Once we have what we need from it then we can allow it to revert to the Runtime version.
Feb 1 '23 #8
DJRhino1175
221 128KB
Ok, I tried the stripped down database with the one table and the code above and 2 forms. One is the pop up box that says closing in 10 secs. The other form is just a dummy form with buttons on it that do nothing. In the first try it worked on my PC and 1 of the production line pc's...The timer is set for 20000 milliseconds on this test database.

We only have a reginal IT guy who is here 2 days a week. I rarely have access to him.

Could the problem be that I close this main form when they open their data entry form?
Feb 2 '23 #9
NeoPa
32,554 Expert Mod 16PB
Hi DJ.

It looks like this is going to be too complex for us to work together on. Such work would require precise following of instructions and clear reporting of the results. Capabilities for both seem to be absent. I know I have a tendency to explain things at a level some will struggle with.

To be fair, such a problem being determined remotely was always going to be a big ask. never mind. I think we gave it a good try.
DJRhino:
Could the problem be that I close this main form when they open their data entry form?
With so little pertinent data I have no way of knowing :-(

PS. Please don't interpret my comments as a criticism of you personally. Being able to communicate well technically is a rare capability. You're unfortunate to have a problem that requires it.
Feb 4 '23 #10
DJRhino1175
221 128KB
I did get this to work. I need the code to be on the form that is open all of the time and not my start up form.

Thanks for the attempt to help.
Feb 10 '23 #11
NeoPa
32,554 Expert Mod 16PB
Hi DJ.

Well, I missed that. The form this Timer Event is actually designed within is the one that gets closed? I rather misinterpreted what you meant there.

Yes indeed. My earlier response should have been that closing the Form associated with the Timer certainly would cause it to stop working. I was still working on the logic, explained in your first post, that it worked fine on your system so the difference had to be something on their system. If your testing was so far mismatched from the actual usage then that would certainly allow for the possibility of it being something else entirely.
Feb 14 '23 #12
NeoPa
32,554 Expert Mod 16PB
As a quick addition to that DJ, what I do is to design a Form that works as both a Startup one and a permanent one (One that closes when, and only when, the database itself closes.) and when you no longer want the Startup part to show then simply hide it rather than close it. That way all your clever stuff that needs to be available all the time is always open when your project is running.

I also have code in my main (Startup) form that repeatedly checks for a message telling it to close down (for the allowance of maintenance tasks).
Feb 14 '23 #13
DJRhino1175
221 128KB
Thanks Neo, I forgot all about the hide form feature.
Feb 14 '23 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mr. B | last post by:
My current app has a timer that I kick ON in my Form1_Load as follows: ' Set Up the Timer Function Dim t As New System.Timers.Timer(12000) ' 1000 = 1 Second t.Enabled = True ' False to Turn OFF...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
10
by: Wayne Aprato | last post by:
I have a database that was written in Access 2003 using the Access 2000 file format. When I run the mdb in Access 2003 everything works fine. If I run it in Access 2000 the timer event won't fire...
5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
0
by: Robm | last post by:
I have a minimized form in a 24/7 app which uses a form timer to check various conditions. Sometimes the timer event stops firing until the mouse is moved or a key is pressed. There are other forms...
4
by: Brian P | last post by:
I have a service that is driven by a timer that fires every 5 seconds. For the most part, it works fine. But every once in a while the timer fires twice. In the log I can see that when it fires...
4
by: sophistiKate | last post by:
I am working with an Access 2003 database. Since adding a timer event to check for idle time to a form, a custom toolbar button that creates a snapshot has stopped working properly. Until the first...
1
by: HONOREDANCESTOR | last post by:
I have a timer which goes off every second and executes some code. I also have a menu item that sets some variables to NOTHING. The problem is that the timer uses some of those variables. If I...
0
by: | last post by:
I have an Access 2007 form timer event that (seemingly at random times) fails to fire. I also have Access VBA code that slows down, sometimes taking 4 or 5 minutes to do what it otherwise does in...
2
by: Salad | last post by:
This was an interesting problem. I open a form, CalledForm. When a record is presented in CalledForm I needed to check the status of something. If the status is met, I needed to present...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.