Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / September 2007

Tip: Looking for answers? Try searching our database.

Microsoft Progress Bar version 6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EAB1977 - 13 Aug 2007 19:51 GMT
Hello everyone,

I am wanting to use the progress bar on a form for a user that has to
transter records but the query is slow. I want to be able to use a
progress bar (ProgressBar5 is the name) to show my user that the
process is still going. Where do I insert my progress bar and how?
This is my first time with the progress bar so a little hand-holding
might be just the ticket I need.

Here is the code I am using right now.

Private Sub btnCQAAnalysis_Click()
On Error GoTo Err_btnCQAAnalysis_Click

   'Get last months CQA Analysis Data
   Set db = CurrentDb
   Set rst = db.OpenRecordset("ProjectedTable")
   'Get the dates from a different form
   DoCmd.OpenForm "frmDates", acNormal, , , , acDialog
   SD = Forms!frmDates!txtStart
   ED = Forms!frmDates!txtEnd
   MsgBox "The upload may take a few minutes to run. Please be
patient.", vbOKOnly + vbInformation
   Set rst2 = db.OpenRecordset("SELECT * FROM qryCQAAnalysisData2
WHERE IssueDate Between #" & SD & "# And #" & ED & "#")
   If rst2.RecordCount = 0 Then
       MsgBox "There are no records for the dates between " & SD & "
and " & ED & ".", vbOKOnly, "No Data"
       DoCmd.Close acForm, "frmDates"
       GoTo Err_btnCQAAnalysis_Exit
   End If
   rst2.MoveFirst
   Do Until rst2.EOF
       rst.AddNew
       'Plant Code
       rst!Code = rst2.Fields(0)
       'Product Code
       rst!ProdCode = rst2.Fields(1)
       'Print Name
       rst!PrintName = rst2.Fields(3)
       'Determine whether the issue date goes in the Product Date
field or Source Date field
       If rst2.Fields(5).Value > 0 Then
           rst!ProductDate = rst2.Fields(2)
           rst!SourceNum = 1
           rst!EnteredDate = rst2.Fields(2)
       ElseIf rst2.Fields(6).Value > 0 Then
           rst!SourceDate = rst2.Fields(2)
           rst!SourceNum = 2
           rst!EnteredDate = rst2.Fields(2)
       End If
       'Number Inspected
       rst!NumInspected = 1
       'Number Wet Ink
       rst!NumWetInk = 1
       rst.Update
       rst2.MoveNext
   Loop

   MsgBox rst2.RecordCount & " records uploaded.", vbInformation +
vbOKOnly
   sfrmProjectedTable.Requery
   DoCmd.Close acForm, "frmDates"

Err_btnCQAAnalysis_Exit:
   Set rst = Nothing
   Set rst2 = Nothing
   Set db = Nothing
   Exit Sub

Err_btnCQAAnalysis_Click:
   MsgBox Err.Description
   Resume Err_btnCQAAnalysis_Exit

End Sub
Tony Toews [MVP] - 16 Aug 2007 19:19 GMT
>I am wanting to use the progress bar on a form for a user that has to
>transter records but the query is slow. I want to be able to use a
>progress bar (ProgressBar5 is the name) to show my user that the
>process is still going. Where do I insert my progress bar and how?

Don't use the progress bar control as you'll run into distribution
problems sooner or later with any controls especially with MS
controls.

Instead use some rectangle controls on a form.  See the Progress Bars
and Microsoft Access page at
http://www.granite.ab.ca/access/progressbar.htm for more info.

>        rst!Code = rst2.Fields(0)

I would urge you to use rs2!FieldName syntax instead of
rst2.Fields(0) as if any one ever changes the query the users could be
doing some very interesting and erroneous updates.

I'd also investigate using IIFs to get all that code working in a
query instead.  That would be much faster.

Tony
Signature

Tony Toews, Microsoft Access MVP
  Please respond only in the newsgroups so that others can
read the entire thread of messages.
  Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
  Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

Doris Mullins - 01 Sep 2007 16:31 GMT
Looking for Nakia Owen
> Hello everyone,
>
[quoted text clipped - 71 lines]
>
> End Sub

Signature

Mullins

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.