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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run in background

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I would like to know how can I run a task in the background and display a message box (if posible with progress bar), saying how it is doing.

I have a MS Access dtb, from it I open a document in word and that takes some seconds depending on the load on the PC, and meantime I would like to display a message with the progress bar, but without buttons.

Thanks,

AmaHerrn
 
What is an Access dtb?

I think this is going to be pretty tough or impossible since it appears to be that you will need a thread to do this and Access won't let you write threads.

However, what I would suggest is that you create a simple form and with some text and create or put an animation on it. Please see Access help file on PictureData property and look at the example. I think this would be an easier and more realistic approach.

Hope this helps,
Rewdee
 
Actually I think it is possible.

One approach is to create a new form with only the buttons and a progressbar on it (progressbar is an ActiveX component), from the script in which you open the Worddocument open the form with the progressbar. Now you can, in the on open event from the progressbar form, define the progression of the progressbar (eg. remotely from the Word-formscript, or based on a counter in the open form event of the progressbarform).
Grtz,

Kalin
 
I tried the option from Kalin, I have a form with only the progress bar.
I open this form from the script that opens my word document.

Dim oWord As Object
Dim oDoc As Object
Dim wordfilename As String

DoCmd.OpenForm "show_progress"
Set oWord = CreateObject("Word.Application")

wordfilename = dbdir & "\extra_files\OPERATING INSTRUCTIONS.doc"

Set oDoc = oWord.Documents.Open(wordfilename)
oWord.Visible = True


The problem is that it opens such form "show_progress" but then opens the document and the progress bar on the form does not move until the doc is opened. Once the doc is opened the code based on the timer starts to work from the beginning.

I have on the form "show_progress" the timer set to 500 and the code:

Public barint As Integer

Private Sub Form_Open(Cancel As Integer)
barint = 0
End Sub

Private Sub Form_Timer()

If barint <= 10 Then
progbar.Value = barint * 10
barint = barint + 1
Else
End If

End Sub


 
I tried it myself and didn't work either :(

I misunderstood your question...
Sorry for not being able to help you. Grtz,

Kalin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top