Link to home
Start Free TrialLog in
Avatar of aentice
aentice

asked on

Bill-Hanson Follow-up PostOpen db

I posted a question yesterday and you helped me resolve it. Below is the answer you gave.
When I tested it again, it made my notes shut down and an error on the left bottom said "Error, Script is Busy".  No other code was added to the db, this is the only one in it. Thanks in Advance.
Sub Postopen(Source As Notesuidatabase)
Call Source.Close
Dim workspace As New NotesUIWorkspace
Call workspace.OpenDatabase ( "ACINOTESOHIO/NotesUS", "3230_030.nsf" )
End Sub
Avatar of daj_uk
daj_uk
Flag of United Kingdom of Great Britain and Northern Ireland image

A quick look would suggest the order is wrong....I would try

Sub Postopen(Source As Notesuidatabase)
Dim workspace As New NotesUIWorkspace
Call workspace.OpenDatabase ( "ACINOTESOHIO/NotesUS", "3230_030.nsf" )
Call Source.Close
End Sub

Basically, open the new database first, before closing the current window.  If you close the current window first I do not think the code will complete.
Avatar of aentice
aentice

ASKER

What I needed to do was close the db that opened the second one. This code do not close the parent.
ASKER CERTIFIED SOLUTION
Avatar of daj_uk
daj_uk
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not sure why you're getting the error message, but It probably has something to do with the event timing.

You may be able to get around the timing issue by trying daj_uk's suggestion.

Setup the 1st database like he says, then the Database.PostOpen event could simply contain...

Sub Postopen(Source As Notesuidatabase)
    Call Source.Close
End Sub
Avatar of aentice

ASKER

Thanks!