473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,385 developers and data experts.

Running code asynchronously

dima69
181 Expert 100+
Somtimes we need to run some code asynchronously. I'll explain this by example.
Suppose you have a listbox and you need to perform some action in the listbox AfterUpdate event procedure. But the problem is that your action is pretty heavy (it involves opening recordset based on complicated query, making some calculations and hiding \ viewing controls, based on the results). So when the user tries to "walk" through the list pressing Up and Down arrows (triggering AfterUpdate event at each step), it appears to be VERY slow.
The solution I present here uses the ability of Access to evaluate calculated fields asynchronously.
1. Create a function in form module.
Expand|Select|Wrap|Line Numbers
  1. Function MyAction() As String
  2. 'put your action code here
  3. End Function
2. On the form, create hidden field with ControlSource as
Expand|Select|Wrap|Line Numbers
  1. =[ListBox1] & MyAction()
This scheme will work like AfterUpdate event, except the case when listbox selection changes too fast. In that case, the MyAction function will only run at the final step, without slowing down user selection.
May 21 '07 #1
0 7548

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

Similar topics

4
by: Si | last post by:
Hi Guys I am using this code to execute an Access VBA function from ASP: strDbName = strDataSource & "data\webjobs.mdb" Set objAccess = Server.CreateObject("Access.Application")...
13
by: BK | last post by:
Can someone point me to a code sample that illustrates executing long running tasks (asynchronous) from a web application in ASP.NET? I assume that Web Services might come into play at some point,...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
7
by: mircu | last post by:
Hello, What would be the best for implementing architecture that runs several, independent, scheduled or run by the user on demand task in the same time? Now in my program every task creates...
0
by: archana | last post by:
Hi all, I am having problem in one web method which i am running asynchronously I set oneway attribute in web method. What i want is once client called this web method this should start...
4
by: Jono | last post by:
Hi Everyone, As it says in the title, I'm looking for a way to display a page while long running operations are performed on the server. Ideally, I'd like some way to push the current request...
4
by: GR | last post by:
Hi, I've got a soap message as a string and would like to post it to a webservice (in C#) asynchronously: For example something like: string soap = "<soap:Envelope...
1
by: skaushik | last post by:
Hi all, I am using Oracle 9.2 version and I had to run a stored procedure asynchronously. I was researching a little bit on this and found that Oracle jobs was a way to do it. Is this the only way...
2
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have a class MyWorker. Each time I create a new instance of MyWorker, I queue it to the ThreadPool. So, 1 MyWorker object is pooled and belongs to its thread (there can't have 2...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.