ADezii 8,834
Recognized Expert Expert
Many Access Users fail to realize that it has a built-in Progress Meter that can display the relative completion percentage of various processes. It is fairly limited, but nonetheless, does provide visual feedback indicating the percent completion of a certain task. The Meter itself, when activated, rests on the left hand corner of the Status Bar and is controlled via the SysCmd() Method. It is straightforward , simple to use, and involves only 3 steps to implement it, These steps are listed below. Following these steps, a code segment involving the updating of a Field within a Recordset, will demonstrate its use. - Initiate the Meter using the acSysCmdInitMet er Action Argument, descriptive text, and a Value Argument which is the Maximum Value of the Meter.
- Periodically update the Meter with the acSysCmdUpdateM eter Action Argument and a Value Argument indicating the relative progress of the task at hand.
- Remove the Meter using the acSysCmdClearSt atus.
- 'The following code will loop through all Records in tblEmployee
-
and Update the value in a newly created Field called [Full Name]
-
to [FirstName] & " " & [LastName]. The relative completion percentage
-
of this operation will be displayed in our Progress Meter.
-
-
Dim MyDB As DAO.Database, MyRS As DAO.Recordset
-
Dim varReturn, intCounter As Long, dblNum, intNoOfRecs As Long
-
-
Set MyDB = CurrentDb()
-
Set MyRS = MyDB.OpenRecordset("tblEmployee", dbOpenDynaset)
-
-
MyRS.MoveLast: MyRS.MoveFirst
-
intNoOfRecs = MyRS.RecordCount
-
- 'Initialize the Progress Meter, set Maximum Value = intNoOfRecs
-
varReturn = SysCmd(acSysCmdInitMeter, "Updating...", intNoOfRecs)
-
-
Do While Not MyRS.EOF
-
With MyRS
-
.Edit
-
![Full Name] = ![FirstName] & " " & ![LastName]
-
intCounter = intCounter + 1
-
'Update the Progress Meter to (intCounter/intNoOfRecs)%
-
varReturn = SysCmd(acSysCmdUpdateMeter, intCounter) .Update
-
.MoveNext
-
End With
-
Loop
-
- 'Remove the Progress Meter
-
varReturn = SysCmd(acSysCmdClearStatus)
-
-
MyRS.Close
NOTE: If updating a large Recordset, you may wish to periodically relinquish control to the Windows Environment using DoEvents. If anyone is interested in how to do this, please let me know,
23 42124
I am using syscmd for the meter....if I do not stay on the screen and go to another application, when I try to come back to the screen it does not update the meter anymore....I have the same thing with msgbox.
Very useful code thank you
I'm using a full screen form am I able to change the place of the update meter ? for example having it as msgbox in my form ..
I'm interesting in DoEvents because I'm using a very large recordset (more than 1000 000 records/ table ) I'm always have delay if I want to select a record in the recordset or navigate using loop ...
Can u explain for me the best way to search a value in a very large recordset ?
Does memories (ram) || cash memory || CPU frequencies || system heat are factors to change the speed of getting a value in a recordset ?
ADezii 8,834
Recognized Expert Expert
Very useful code thank you
I'm using a full screen form am I able to change the place of the update meter ? for example having it as msgbox in my form ..
I'm interesting in DoEvents because I'm using a very large recordset (more than 1000 000 records/ table ) I'm always have delay if I want to select a record in the recordset or navigate using loop ...
Can u explain for me the best way to search a value in a very large recordset ?
Does memories (ram) || cash memory || CPU frequencies || system heat are factors to change the speed of getting a value in a recordset ?
The most efficient and fastest way to search for a value in a very large Recordset is by using the Seek() Method. It must, however, be based on a Table Type Recordset. Everything you mentioned is more than likely a factor that effects the speed with which searches can be done, but one of the most critical factors, in my opinion, is whether or not the Field is Indexed.
Here is the error I am getting now: "You can't reference a property or method for a control unless the control has the focus."
Here is my exact code for picking from two choises. I only get this error on the first choice, but don't get anything in the text box with the second one. -
Private Sub StandardizedAllocation_AfterUpdate()
-
If StandardizedAllocation.Text = "HOUSE MEETINGS:" Then StandardizedAllocationSumm.Text = "Consult with direct care staff ongoing medical concerns and plan of care."
-
If StandardizedAllocation.Text = "MD Appt.Prep:" Then StandardizedAllocationSumm.Text = "Case file reviewed for pending medical appointment. Plan of care reviewed and updated."
-
-
End Sub
-
ADezii 8,834
Recognized Expert Expert
Here is the error I am getting now: "You can't reference a property or method for a control unless the control has the focus."
Here is my exact code for picking from two choises. I only get this error on the first choice, but don't get anything in the text box with the second one. -
Private Sub StandardizedAllocation_AfterUpdate()
-
If StandardizedAllocation.Text = "HOUSE MEETINGS:" Then StandardizedAllocationSumm.Text = "Consult with direct care staff ongoing medical concerns and plan of care."
-
If StandardizedAllocation.Text = "MD Appt.Prep:" Then StandardizedAllocationSumm.Text = "Case file reviewed for pending medical appointment. Plan of care reviewed and updated."
-
-
End Sub
-
You use the Text property to set or return the text contained in a Text Box or in the text box portion of a Combo Box. It is a Read/write String. To set or return a control's Text property, the Control must have the focus, or an error occurs. If you are just concerned with setting/retrieving the value in the Control itself, then adjust your code to: - Private Sub StandardizedAllocation_AfterUpdate()
-
If Me![StandardizedAllocation] = "HOUSE MEETINGS:" Then
-
Me![StandardizedAllocationSumm] = "Consult with direct care staff ongoing medical concerns and plan of care."
-
ElseIf Me![StandardizedAllocation] = "MD Appt.Prep:" Then
-
Me![StandardizedAllocationSumm] = "Case file reviewed for pending medical appointment. Plan of care reviewed and updated."
-
Else
-
'not sure what you want to do here, if anything
-
End If
-
End Sub
Awesome, sorry I posted this in the wrong place, but working on three databases at the same time. Worked perfect.
ADezii 8,834
Recognized Expert Expert @djbit:
Hello ADezzi, I saw your article on using the access progress bar. it worked nicely thanks!
Anyways, you mentioned in the notes that you could implement this along with the DoEvents function. Can you show me how you would do that. I have a process that takes about 5-10 minutes and I think this DoEvents thing is needed.
This Logic would be used when processing very large Recordsets, which yours apparently is. In the partial Code listing below, it will periodically check the Environment ever 50,000th Iteration of the Loop. You can, of course, vary this number. Later on, I'll send you an Attachment illustrating amuch simpler, and more graphic technique, of accomplishing the same thing. - 'Code intentionally removed.............................................
-
Do While Not MyRS.EOF
-
With MyRS
-
.Edit
-
![Full Name] = ![FirstName] & " " & ![LastName]
-
intCounter = intCounter + 1
-
'Check the Environment every 50,0000th Iteration
-
If intCounter Mod 50000 Then DoEvents
-
'Update the Progress Meter to (intCounter/intNoOfRecs)%
-
varReturn = SysCmd(acSysCmdUpdateMeter, intCounter)
-
.Update
-
.MoveNext
-
End With
-
Loop
-
'Code intentionally removed.............................................
P.S. - Got back to adding that Attachment that I was referring to.
ADezii, thank you very much! I will look into making this work in my application.
Hi ADezii,
I want to update about 4 tables (quite much data in each table) with click of a command button. And I would like to show users progress bar with respect to data uploaded in each table.
How can make use of above code for that.
I am using following codes for updating data in the tables. (I have written a very bad code- as I am still learning stage) - Private Sub Command1_Click()
-
DoCmd.Hourglass True
-
DoCmd.SetWarnings False
-
DoCmd.OpenQuery ("updateZDBCT0111")
-
DoCmd.OpenQuery ("updateZD008")
-
DoCmd.OpenQuery ("updateZD010")
-
DoCmd.OpenQuery ("updateZD012")
-
MsgBox "Data Updated"
-
DoCmd.Hourglass False
-
DoCmd.SetWarnings True
-
Me.Requery
-
End Sub
Please help me..
Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Julia Briggs |
last post by:
Hello,
I've read quite a bit of discussion on different approaches of how to
create a download progress meter that can be implemented into a Web
site. I understand that by the very nature of the way the download
transport is handled that this cannot "automatically" be done...
upload progress meters exist, but not download. However, I've seen
different theories on how it could be done if one knows the file size.
Is anyone aware of a...
|
by: Brian Birtle |
last post by:
**** A CHALLENGE TO THE GURUS - refute the statement "It's impossible
to build a file upload progress meter using ASP.NET" **** First person
to prove me wrong gets "All Time .NET Programming GOD" listing in my
address book and (optionally) their name listed on my "news" page of
my birtle.com website (listed as "Jane Smith is a Programming GOD")
for at least a month. Why not take a moment to read more and possibly
boost your ego to all time...
|
by: Doug |
last post by:
In I.E. 6 (and probably other versions as well), there is a sort of progress
meter in the panel at the bottom of the window. This meter increments a few
pixels at a time when the browser is trying to connect or do some other
operation that is taking more than a few seconds.
My suspicion is that there is no way that this "progress meter" can actually
be metering anything meaningful (at least with respect to whatever is being
downloaded or...
|
by: Brian Henry |
last post by:
I created a smooth progress bar with this code.. but if you update the
values in a row quickly of it and watch it on screen it flickers... how
would i change this to reduce the flickering? thanks...
Imports System
Imports System.Drawing
Imports System.Drawing.Drawing2D
|
by: bfulford |
last post by:
I have a macro that needs to have a progress meter displayed since it
is long running. I moved the Macro's instructions to a table and pulled
those records into a recordset that is looped through.
PROBLEM -- The form, with a progress meter and labels to inform the
user as to which step of a series of instructions is being done and the
overall progress, seems to lock from repainting after the first
docmd.openquery because the form is never...
| |
by: Eric Pradel |
last post by:
Hi,
This is my first post, and I'm a real newcomer to scripting. I have a script that is doing exactly what I want it to do, which is to open a new window with set specifications. However, in the opened window, the progress meter in the status bar "sticks" at about halfway and the hourglass icon appears even though the page has otherwise finished loading (its contents are a few paragraphs of text only.) It's as if the window is expecting...
|
by: Adam R |
last post by:
Looking for an upload progress meter which can works with 'non-patched'
PHP4.
--
--------------------------------------
Adam Raszkiewicz
Brothers-in-arts.com
--------------------------------------
|
by: maniesh |
last post by:
I want to complete a project and I want to place a timed progress bar on my splash screen, I want to find out a method of timing my progress bar to update every 10 seconds.
here's what I got so far:
Private Sub Form_Open(Cancel As Integer)
If (ProgressBar0.Value <0) then
ProgressBar0.Value = ProgressBar0.Value +10
End If
ProgressBar0.Value =100
End Sub
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |