Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Control ProgressBar 3

Status
Not open for further replies.

Fekri

Programmer
Jan 3, 2004
284
0
0
IR
Hi,

I was searching for any Progressbar to add in my form to show the level of quantity.

So, I found the Microsoft ProgressBar Control 6.0 in ActiveX Control list.

But I don'r know how I can bound it with Quantity Value in form textbox?

is there anybody can help me?
thanks
Ali
 
It can't be bound in the same way a text box might have a ControlSource property. Use the following argument to respond to changes in Quantity Value (Form OnCurrent event or Control AfterUpdate event etc.)

ProgressBar.Value = Me.Controls("Quantity Value").Value
 
To add to Ian's response the .Value property needs to be updated with a value between 0 and 100 (the percentage completion).

Ed Metcalfe.

Please do not feed the trolls.....
 
Not quite ed. The ProgressBar has Min and Max properties which can be defined by the user too.
 
thanks to all,

but now, I want to use this activeX in other way,

I want to show this activeX when my event are running to show how much is progress and how much the user should wait!!

the event is to link all the tables to other file.

thanks
ali
 
Ian - Now I never knew that. I've always calculated the percentage complete and then passed it to the control. Have a star. :)

Ali - If you post the code you have so far we'll take a look.

Ed Metcalfe.

Please do not feed the trolls.....
 
ok,

this is the code which I have to wait for a moment when copy finished:

Private Sub Command99_Click()
Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Access Files (*.MDB)", "MDB")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=False, _
DialogTitle:="áØÝÇ äÇã ÝÇíá ÌÏíÏ ÑÇ æÇÑÏ äãÇÆíÏ...", _
Flags:=ahtOFN_HIDEREADONLY)

'-------------------------------------------------------------------
' PURPOSE: Copy a file on disk from one location to another.
'-------------------------------------------------------------------
Dim CopyString As String
Dim SourceFile As String
Dim DestFile As String
Dim TimeStamp As String
If strInputFileName <> "" Then
SourceFile = Chr(34) & [Master Data Location] & Chr(34)
DestFile = Chr(34) & strInputFileName & ".mdb" & Chr(34)
CopyString = "CMD.EXE /C COPY " & SourceFile & " " & DestFile
Call Shell(CopyString, vbNormalFocus)
End If

'-------------------------------------------------------------------
' PURPOSE: Link to DestFile created on above.
'-------------------------------------------------------------------

Dim i As Integer
DestFile = strInputFileName & ".mdb"
If IsNull(DestFile) Then
MsgBox "åí? ÝÇíáí ÓÇÎÊå äÔÏå ÇÓÊ!", vbExclamation
GoTo Done
End If
For i = 1 To UBound(LinkedTables, 2)
LinkedTables(4, i) = DestFile
Next i
LinkErrors = False
DoCmd.Hourglass True
For i = 1 To UBound(LinkedTables, 2)
LinkedTables(3, i) = AttachTable(LinkedTables(0, i), LinkedTables(4, i), LinkedTables(2, 1))
If Len(LinkedTables(3, i)) > 0 Then LinkErrors = True
Next i
DoCmd.Hourglass False
If LinkErrors = True Then
Me.ViewTabs.Pages("List").Visible = False
Me.ViewTabs.Pages("Errors").Visible = True
Me.ViewTabs.Pages("Errors").SetFocus
MsgBox ("ÚãáíÇÊ ÇÊÕÇá Èå ÈÇä˜ ÏÑÎæÇÓÊí ÌÏíÏ ÏÇÑÇí ÎØÇ ãí ÈÇÔÏ")
Else
If Me.OpenArgs = "Startup" Then
DoCmd.Close
Exit Sub
End If
Me.ViewTabs.Pages("List").Visible = True
Me.ViewTabs.Pages("Errors").Visible = False
Me.listStatus.Requery
Me.listStatus.SetFocus
'-------------------------------------------------------------------
' PURPOSE: To make requery and cleaning the tables.
'-------------------------------------------------------------------
Stdoc = "main form"
DoCmd.Close acForm, Stdoc
DoCmd.OpenForm Stdoc
DoCmd.OpenQuery "Deete Invoice"
DoCmd.OpenQuery "Delete Check Detail"
DoCmd.OpenQuery "Delete Havale Anbar"
DoCmd.OpenQuery "Delete Main Master Document"
DoCmd.OpenQuery "Delete Master Document"
DoCmd.OpenQuery "Delete Personel Working Detail"
DoCmd.OpenQuery "Delete Resid Anbar"
DoCmd.OpenQuery "Delete Ship Info"
Stdoc = "ezf_AttachmentManagerOneFile"
DoCmd.Close acForm, Stdoc
Forms![Main Form]![Master Data Location] = DestFile
Stdoc = "Name Registery"
DoCmd.OpenForm Stdoc
Stdoc = "Warning1"
stLink = "
Code:
=" & 83
        DoCmd.OpenForm Stdoc, , , stLink
    End If
Done:
End Sub



   thanks for your help
      Ali
 
For more detail:

during this event are running it's better the progress bar should show the progress even very short time..

thanks
Ali


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top