473,385 Members | 1,630 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,385 software developers and data experts.

Updating Records.....Show Progress in a form error

Morning/Afternoon all,

Having slight problem with showing users the progress of a query.....

Bit of background....The database allows users to view the status of documents i.e. Completion date, revision etc. The project manager has an MS Project file in which he changes the estimated date of comepletion of each document.

I currently have Ms Project auto generate a database table everytime it is saved. This table is linked into my database and is updated when the filter form is opened (see code below).

My problem is that as the information is being passed across the local LAN it can take a bit of time (15-20 secs atm, but I anticipate that this will grow as the database expands), and as users are usually so patient I want to inform them that the database hasnt crashed by displaying some information

I have tried several different methods (one below is probably the most simple of them yet) but I keep ending up with the same error....."2001 - You canceled the previous operation" Or

I know that the problem is caused because records are being modified because if I take out anything to do with modifying the records, the status is shown perfectly.

Open to any suggestions? Thanks in advance!

Private Sub Form_Load()

fixeddate = "24/05/2007" 'DO NOT CHANGE THIS VALUE!!!!!!!!

imax = DMax("[unique_id]", "[tbl_Projectimport]")

tbox_OutOf = DCount("[unique_id]", "[tbl_Projectimport]")

i = 1

RecordNo = 1

Do While i <= imax

ProjectDate = DLookup("[finish_date]", "[tbl_Projectimport]", "[Unique_ID] = UniqueID") ' & Me.Unique_ID)

If IsNull(ProjectDate) Then
Exit Do
End If

ProjectDate = Left(ProjectDate, 10)

UpdatedDate = ProjectDate

filterdate = DateDiff("d", fixeddate, ProjectDate)

DoCmd.GoToRecord , , acNext

tbox_CurrentNo = RecordNo

i = i + 1

RecordNo = RecordNo + 1

Loop

DoCmd.Close

DoCmd.OpenForm "DRL_Filter"

End Sub
Jun 25 '07 #1
2 1732
MMcCarthy
14,534 Expert Mod 8TB
Sorry Phil

Without Access to your database this code is out of context and I can't actually tell what it is doing.

What operation is being preformed? Technically I mean.

You say you want the users to be informed of the status of this operation with some kind of notice. This is usually done by tying the code of the operation to a form load event of a simple form with a sign on it informing users of the status. The form can then be closed at the end of the process.

Without a better understanding of what is going on I can't really help further.
Jun 28 '07 #2
ADezii
8,834 Expert 8TB
Morning/Afternoon all,

Having slight problem with showing users the progress of a query.....

Bit of background....The database allows users to view the status of documents i.e. Completion date, revision etc. The project manager has an MS Project file in which he changes the estimated date of comepletion of each document.

I currently have Ms Project auto generate a database table everytime it is saved. This table is linked into my database and is updated when the filter form is opened (see code below).

My problem is that as the information is being passed across the local LAN it can take a bit of time (15-20 secs atm, but I anticipate that this will grow as the database expands), and as users are usually so patient I want to inform them that the database hasnt crashed by displaying some information

I have tried several different methods (one below is probably the most simple of them yet) but I keep ending up with the same error....."2001 - You canceled the previous operation" Or

I know that the problem is caused because records are being modified because if I take out anything to do with modifying the records, the status is shown perfectly.

Open to any suggestions? Thanks in advance!

Private Sub Form_Load()

fixeddate = "24/05/2007" 'DO NOT CHANGE THIS VALUE!!!!!!!!

imax = DMax("[unique_id]", "[tbl_Projectimport]")

tbox_OutOf = DCount("[unique_id]", "[tbl_Projectimport]")

i = 1

RecordNo = 1

Do While i <= imax

ProjectDate = DLookup("[finish_date]", "[tbl_Projectimport]", "[Unique_ID] = UniqueID") ' & Me.Unique_ID)

If IsNull(ProjectDate) Then
Exit Do
End If

ProjectDate = Left(ProjectDate, 10)

UpdatedDate = ProjectDate

filterdate = DateDiff("d", fixeddate, ProjectDate)

DoCmd.GoToRecord , , acNext

tbox_CurrentNo = RecordNo

i = i + 1

RecordNo = RecordNo + 1

Loop

DoCmd.Close

DoCmd.OpenForm "DRL_Filter"

End Sub
I agree with Mary and an also very confused. In General Terms, if you want a visual indicator to give the User some idea of the progress of an operation, you can use the built-in Progress Meter within Access. It's not much, but it is better than no indicator at all. Here is the general idea:

'----------------- Code Prior to Loop ------------------
Dim varRet As Variant, strShow As String

strShow = "Stay tune while I do some calculating..."

'Initialize Meter with the Maximum Value (imax)
varRet = SysCmd(acSysCmdInitMeter, strShow, imax)
'----------------------------------------------------------------


'--------------- Code Placed Within Loop ---------------
'Progress Meter updated with each Increment of RecordNo
varRet = SysCmd(acSysCmdUpdateMeter, RecordNo)
'----------------------------------------------------------------


'------------------ Code Placed After ------------------
varRet = SysCmd(acSysCmdRemoveMeter)
'----------------------------------------------------------------
Jun 29 '07 #3

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

Similar topics

3
by: Joe | last post by:
Hi there, question regarding Access 2000 - locking records: I want to be able to lock a record (or several records) on a form so that particular record can not be edited until I undo the lock (im...
1
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass...
7
by: Steve Kallal | last post by:
I have seen this subject tossed around in this forum before. But in my case I need a simple solution. I do NOT need to show progress in terms on percentage complete. But rather I need to show a...
7
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
2
by: Geoff Jones | last post by:
Hi I have been using a smooth progress control using the following link: http://support.microsoft.com/default.aspx?scid=kb;en-us;323088#2 It works well, however I can't seem to get it to...
2
by: Sanjaylml | last post by:
I have made a form in Access 2000. In addition to just simply enter the data through form, I have appended sub-form in main form to show the all the entered records as Sub-Form (DataSheet), which is...
4
by: frozenade | last post by:
Hello all.. merry christmas.. :) I need to show progress status when a button is clicked. I use this script. but I know that this code is still very bad. <html>
1
by: Ands | last post by:
Hi At the risk of showing my ignorance I wondering if anyone can advise me how best to update records behind a form. Here's the problem I am using Access 2002 and have a single form bound to a...
7
by: RG360 | last post by:
Hello. I am new in Access and I need assistance from Pro's I have a data entry form from 2 main tables and they have relationships with other tables. My main table only contains Field ID's,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.