Subject: Launch DB to Form in Client
It is possible, I struggled with this quite a bit until I found a solution.It really is a bit complicated so I’ll do my best to lead you through it all.
- You will need a frameset. Don’t worry, we will only use it for the start-up phase and you won’t need it afterwards.
So, create a simple frameset with 2 frames.
Name the frames ‘left’ and ‘right’ for simplicity.
-
Create a blank page for your left frame, call it ‘pgBlank’ and set you left frame to load that page.
-
Create a new form for your right frame.
Call it ‘(redirect)’.
Create a hidden text field, editable, name it ‘SaveOptions’ and give it default value of “0”. (alphanumeric zero)
Create another hidden text field, computed, name it ‘redirectto’ and give it the the following value:
“notes:///” + @ReplaceSubstring(@ReplicaID; “:”; “”) + “/thenameofyourform?openform”
You should of course replace ‘thenameofyourform’ with the name of the form you want to load.
In the onLoad event of the form, specify ‘Client’, ‘JavaScript’ and this value: doRedirect()
In the JS Header part of the form, specify 'Client, ‘JavaScript’ and this code:
function doRedirect() {
// Immediately redirect to the default view.
top.location.href = document.forms[0].redirectto.value;
}
OK, now set your right frame to use this form.
In the database properties (in Designer), set the database to open your new frameset when opened.
What will happen is this:
-
The database opens and loads the frameset.
-
Your (redirect) form will immediately redirect to the form you really want to load, and it will do it in the ‘top’ frame, thereby overriding the frameset.
Voila.
Hope this helps.
ken@noteshound.com