jackel7007
12-02-2011, 07:46 AM
Hello All,
here goes my first post on this forum, hope to get some help and be able to help some others out!
I have this Access database which has a button that links to a word document.
The button in access has a hyperlink on it with the adress of the word document.
When I start the document manually it does the following:
1. start word
2. open the document
3. (after little loading) gives me the form on front of the document and waits for my input..
Which is correct :-)
When I use the hyperlink I get this hourglass and only the form is loaded (so no word windows at all)
Since the form is in the background it's quite hard to find it.
After clicking the list in the form word does open and works fine, but i would like to have the popup in front of access and not behind!
So launching of the doc is done by hyperlink.
And this is a part of the code which should popup the form:
Private Sub Document_Open()
On Error GoTo ErrorHandler
Set doc = ThisDocument
'Open het Index workbook
Set wbIndex = xlApp.Workbooks.Open(FileName:=doc.Path & "\" & "El Tracing Index.xls", ReadOnly:=True)
Do
EqSelect
intKeuze = MsgBox("Open form " & strEqSelect & "?", vbYesNoCancel)
Loop While intKeuze = vbNo
If intKeuze = vbCancel Then
GoTo Sluiten
End If
ReadData
FormInvullen
Close:
wbIndex.Close False
xlApp.Quit
Set wbIndex = Nothing
Set xlApp = Nothing
Exit Sub
ErrorHandler:
MsgBox ("There is an error, program will close" & vbCrLf & _
Err.Number & ", " & Err.Description)
GoTo Close
End Sub
I expect the problem to be in the following statement:
Set doc = ThisDocument
ThisDocument will be the word when you start it directly, but when launching the hyperlink from Access the ThisDocument might be refering to Access?
I am out of options..... and since i'm not a reall Office specialist i kindly ask for your help! It would be mutch appreciated!
here goes my first post on this forum, hope to get some help and be able to help some others out!
I have this Access database which has a button that links to a word document.
The button in access has a hyperlink on it with the adress of the word document.
When I start the document manually it does the following:
1. start word
2. open the document
3. (after little loading) gives me the form on front of the document and waits for my input..
Which is correct :-)
When I use the hyperlink I get this hourglass and only the form is loaded (so no word windows at all)
Since the form is in the background it's quite hard to find it.
After clicking the list in the form word does open and works fine, but i would like to have the popup in front of access and not behind!
So launching of the doc is done by hyperlink.
And this is a part of the code which should popup the form:
Private Sub Document_Open()
On Error GoTo ErrorHandler
Set doc = ThisDocument
'Open het Index workbook
Set wbIndex = xlApp.Workbooks.Open(FileName:=doc.Path & "\" & "El Tracing Index.xls", ReadOnly:=True)
Do
EqSelect
intKeuze = MsgBox("Open form " & strEqSelect & "?", vbYesNoCancel)
Loop While intKeuze = vbNo
If intKeuze = vbCancel Then
GoTo Sluiten
End If
ReadData
FormInvullen
Close:
wbIndex.Close False
xlApp.Quit
Set wbIndex = Nothing
Set xlApp = Nothing
Exit Sub
ErrorHandler:
MsgBox ("There is an error, program will close" & vbCrLf & _
Err.Number & ", " & Err.Description)
GoTo Close
End Sub
I expect the problem to be in the following statement:
Set doc = ThisDocument
ThisDocument will be the word when you start it directly, but when launching the hyperlink from Access the ThisDocument might be refering to Access?
I am out of options..... and since i'm not a reall Office specialist i kindly ask for your help! It would be mutch appreciated!