|
-
Dec 4th, 2007, 08:55 AM
#1
Thread Starter
PowerPoster
ProgressBar help needed
Hi Guys,
I need to show a progressbar while the following sub is being executed:
The progressbar will be on another form and it should show while the sub is being executed and once the sub has executed, it must dissappear.
I tried doing it but the progressbar wasn't showing any progress. I've deleted what I tried.
Could someone please modify the following code to include the progressbar.
Code:
Private Sub cboSite_Click()
On Error GoTo errh
cmdPrintSiteInfo.Enabled = False
SiteNum = cboSite.ItemData(cboSite.ListIndex)
Call LoadSite(SiteNum)
LoadConsumable (SiteNum)
Call LoadSiteInfo("({Command.SiteId} = " & SiteNum & ")")
cboNotes.Enabled = True
Call PopulateNoteCombos(SiteNum)
'Unload Form3
NewRecNote = False
NewNote = False
cmdPrintSiteInfo.Enabled = True
Exit Sub
errh:
errmsg "The following Exception occured : " & ERR.Description & ", " & ERR.Source & "", "Exception occured in frmItemManager.cboSite_Click()"
End Sub
Last edited by Nitesh; Dec 4th, 2007 at 09:21 AM.
Reason: removing error
-
Dec 4th, 2007, 09:04 AM
#2
Re: ProgressBar help needed
You have a Loop call in there without any Do Until call.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 4th, 2007, 09:19 AM
#3
Thread Starter
PowerPoster
Re: ProgressBar help needed
 Originally Posted by RobDog888
You have a Loop call in there without any Do Until call.
sorry, forgot to remove that. that was the remains of the code I tried. Will remove it now.
-
Dec 4th, 2007, 09:27 AM
#4
Re: ProgressBar help needed
Ok, so between the two cmdPrintSiteInfo.Enabled lines is what your processing and would like a progressbar to show?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 4th, 2007, 09:35 AM
#5
Thread Starter
PowerPoster
Re: ProgressBar help needed
-
Dec 4th, 2007, 09:40 AM
#6
Re: ProgressBar help needed
Then its not going to be possible to get an accurate representation as some functions will take longer then others.
Try...
Code:
cmdPrintSiteInfo.Enabled = False
Progressbar1.Min = 0
Progressbar1.Max = 60
Progressbar1.Value = 0
SiteNum = cboSite.ItemData(cboSite.ListIndex)
Progressbar1.Value = 10
Call LoadSite(SiteNum)
Progressbar1.Value = 20
LoadConsumable (SiteNum)
Progressbar1.Value = 30
Call LoadSiteInfo("({Command.SiteId} = " & SiteNum & ")")
Progressbar1.Value = 40
cboNotes.Enabled = True
Progressbar1.Value = 50
Call PopulateNoteCombos(SiteNum)
'Unload Form3
Progressbar1.Value = 60
NewRecNote = False
NewNote = False
cmdPrintSiteInfo.Enabled = True
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|