Carmen
Registered User.
- Local time
- Today, 16:58
- Joined
- Nov 30, 2001
- Messages
- 58
Hi All,
I have a database that tracks documents received for translation. The request is logged via a form and assigned a Category and Subcategory (which correspond to folders on our server where the translator will save the completed document). When the document is complete, the translator adds the Document Name to the record (via a linked form). I have a button on the main form to View the completed document. So far all this works great. My problem is that after I've viewed the document, which is in Word or Publisher or whatever, and close the document's application, my Access form is minimized on the taskbar and I'm looking at my Desktop. I want the user to be able to close Word, for example, and have the form be maximized again. Not sure how to accomplish that. Here is my code that opens the document:
Any ideas?
Thanks in advance!
Carmen
I have a database that tracks documents received for translation. The request is logged via a form and assigned a Category and Subcategory (which correspond to folders on our server where the translator will save the completed document). When the document is complete, the translator adds the Document Name to the record (via a linked form). I have a button on the main form to View the completed document. So far all this works great. My problem is that after I've viewed the document, which is in Word or Publisher or whatever, and close the document's application, my Access form is minimized on the taskbar and I'm looking at my Desktop. I want the user to be able to close Word, for example, and have the form be maximized again. Not sure how to accomplish that. Here is my code that opens the document:
Code:
Private Sub cmdViewDoc_Click()
On Error GoTo HandleErrors
'open the translation document
Dim strFileName As String
Dim strExt As String
Dim strDirectory As String
Dim intFile As Long
Dim myDir
Call cmdCompletion_Click 'opens the linked form containing the document
'name
Me.SetFocus
strDirectory = "\\elant01\data\shared\Translations\" & _
Forms!frmTranslationRequest!cboCategory.Column(1) & "\" & _
Forms!frmTranslationRequest!cboSubCategory.Column(1)
strFileName = Forms!frmCompletionInfo!DocumentName
myDir = strDirectory & "\" & Dir(strDirectory & "\*.*")
Do While myDir <> ""
intFile = InStr(1, myDir, strFileName, vbTextCompare)
If intFile <> 0 Then
strExt = Right(myDir, Len(myDir) - _
InStrRev(myDir, "."))
Exit Do
End If
myDir = Dir
Loop
Me.cmdViewDoc.HyperlinkAddress = strDirectory & "\" & strFileName & _
"." & strExt
DoCmd.Close acForm, "frmCompletionInfo"
Exit_cmdViewDoc_Click:
Exit Sub
HandleErrors:
If Err = 94 Then
Err = 0
MsgBox "This translation is not yet completed.", vbOKOnly
Resume Next
Else
MsgBox Str(Err)
MsgBox Err.Description
Resume Exit_cmdViewDoc_Click
End If
End Sub
Any ideas?
Thanks in advance!
Carmen
Last edited by a moderator: