The LONG story:
I have some communication between Excel and Acces going on when the user dobble-clickks on ONE of many shapes on a timeline in Excel.
The shape in Excel represents an EVENT filed in Access and the result of the dobble-click in Excel is Access showing that EVENT in a form.
It works nicely, no problem here !
In Access the event have a word document assigned to it - just as a file - no BLOB ext ext involved ... pure simple solution ... and it's working nicely !
A checkbox named "chbPrivat" in the event form can MARK the word document as PRIVATE and then the user can't open the document in ACCESS unless he knows the password.
Of cause he should ALSO be prevented from opening it from Excel.
I use this code in Access CALLED from Excel:
Code:
Public Sub getDocument() ' called FROM Excel when an event is dobble-clicked on my timeline in Excel
If chbPrivat = False Then
Sti_til_fil.SetFocus
Sti_til_fil_DblClick False
Else
SetForegroundWindow hWndAccessApp
Meld ("Dette dokument er markeret som 'Privat'," & CrLf(1) & _
"og kan dermed ikke åbnes fra tidslinien !")
End If
End Sub
If the "chBPrivat" is false then I set focus the the field with the filename and perform a dobble-click to show the word document in Word - this works nicely both from within Access AND from within Excel - no problem here !
The SHORT story:
The 'Else ... End If ' part is ONLY used when the document related to the event is marked as PRIVATE - the user should then be informed that it's private.
I do that in Access (because all the data and code is there !) so I have to FORCE Access in FRONT and then show my messagebox ('Meld' is just my very simplified MsgBox !)
The problem is Access will NOT come to the front !
When the user dobble-clicks on an event in Excel (with a private marked document in Access) the cursor changes to that "light blue spinning circle = wait a while" and I MYSELF HAVE to shift to Access to see the msgbox !
What is wrong here and what can I do to cure it ?