473,666 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unbound Form "AutoLoad" Event Issue

2 New Member
I have been asked to develop an application in Access for work. This application must have a simple user interface because the folks using it are not "database people" - their words, not mine.

One of the "screens" they want to see will display a progress bar. I created the "screen" in a form. I do not currently have it bound to any data because it is not intended to display any records. It's sole purpose is to show the progress bar (and some text describing what it's doing) while visual basic does some magic in the background.

Here is the issue I'm having. If I put my code into the onclick event of a button, everything works fine - exactly how I want it to.

If I put my code into the forms onload event, the code executes prior to the form being displayed - as expected, right? But we want to see the progress bar change as VBA does its deal. Because the form hasn't been displayed yet, you just wait until VBA is done, and then get the form displayed showing a full progress bar and text indicating that VBA is finished with its job. So onload is definitely not where I want the code. - Please note that the form actually hasn't displayed yet, so repainting the form won't help here.

But if I put the code into the forms onactivate event, nothing happens. The form is displayed, but the code never executes.

I understand that onload fires prior to the display of the form. onactivate supposedly fires after the form is displayed (and I guess it can fire after that too depending upon focus, etc.). But even if I put some very simple code in the onactivate event - like msgbox ("Hi there.") - , nothing happens.

I thought maybe the form had to have a record source for onactivate to fire, so I've tried actually binding the form to a record source, but it didn't help. Then I tried actually displaying a record from that record source on the form, but it didn't help. I simply can't seem to get the onactivate event to fire.

What am I missing? I'm sure it is something rediculously simple and I'll go ahead and apologize for being a big dummy. But I'm stumped and would really appreciate some help.

For now, I'm just going to make them click the button to get it all started until I get this thing figured out. Thanks in advance for helping to push back my ignorance!
Oct 12 '08 #1
4 2733
FishVal
2,653 Recognized Expert Specialist
Hello, Robert.

I suppose you should put your code in Timer event handler having set TimerInterval to let us say minimal value = 1ms.

Form will not be visible while all the following events are being handled.

Open
Load
Activate
Got focus
Current

Regards,
Fish
Oct 12 '08 #2
robertallenpayne
2 New Member
Hello Fish!

You know, it's amazing how we get caught up in "what we know" about how things work. I had originally dismissed the timer function because I was SURE that once I put something in the ontimer event, that it would continue to execute at the specified interval until the cows came home or the form was closed. I just assumed that setting the timer interval to zero would just repeatedly fire the code.

But your solution was perfect! I set the form's timer interval property to 50. It displays the form perfectly, then 50 ms later fires the code. The first line of the code sets the timer interval back to zero. And no matter how long the box stays open, the code only fires one time!

Outstanding. And I didn't even have to release my version with the command button!

I wonder how many other functions and events I "think" I know....

Thanks again!
Oct 12 '08 #3
FishVal
2,653 Recognized Expert Specialist
You are welcome.
Good luck.
Oct 12 '08 #4
NeoPa
32,568 Recognized Expert Moderator MVP
Nice one Fish.

I was intrigued, and did some testing. Open AND Load were both executed before the form was even visible. Yours is a clever solution to the problem :)
Oct 12 '08 #5

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

Similar topics

6
3034
by: Fan Ruo Xin | last post by:
Last monday, I tried to create a working table, and failed because of 'Log Full'. There were two applications running at that time - one is autoload (during the split phase), another one is "insert into a (NLI) ... SELECT ... FROM ...". I checked the db2diag.log (level=4) and notification file. It was interesting that there was no any information about log full. I had to kill the autoload process. I haven'g got time to see if I can...
10
2018
by: Luke Meyers | last post by:
So, just a little while ago I had this flash of insight. It occurred to me that, while of course in general there are very good reasons for the conventional two-file header/implementation separation for each C++ class, there are cases in which this paradigm contributes nothing and simply introduces extra boilerplate overhead. The particular case I have in mind is CppUnit tests. Each test header is only ever included by the...
5
2203
by: lister | last post by:
Hi all, I have a fairly diverse range of data that I want to cache in the session rather than pulling it from the database on every page refresh. The problem is is that it seems that PHP requires the class definitions available on EVERY page, as it unserialises everything even if it's not going to be used.
4
1672
by: CCHDGeek | last post by:
I have a form that opens when an Access 2003 database starts up. In the VBA for the form, I have a complex function that is copying files from various folders and updating several tables. But the form either disappears as its processing or never completely loads - so it looks like nothing is happening to the end-user. I've tried using Me.Repaint Me.Refresh And neither of those is making the form visible during the VBA processing. Can...
0
8787
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6203
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.