Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript with access database templates

Status
Not open for further replies.

fleart1

Technical User
Jun 6, 2004
24
US
I have an application that uses access as a record and page template. Each page has a separate page number column and there are 4 fields:1,2,3,4 of 255 chars each.
When I insert
<script>
function openWindow(wndURL)
{
window.open(wndURL,null,"width=700,height=500,scrollbars=yes");
}
</script>
I can open a window in the application when I click a link or image. Problem is I want to use a large javascript to make it snow on one of the pages but the code is extremely long.
Is there a way to make a module to call this script to make it work in this access database template or is this window command some property of the window only?? Any ideas?
thanks
 
I'll jump in just to say I didn't understand your question. Perhaps others have similar difficulties. First, you say you have an "application". Is this a web-based application? Windows-based? Written in what language?

Most of the questions in this forum deal with web-browser JavaScript, and it isn't clear to me that this is true in your case.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
HI,
sorry for not being clear. The data in the database templates writes to a windows browser window. when I use the script I menitoned, it opens the window fine in the windows window. I didnt know if this worked simply because the windows browser properties allowed this or if not.
I wanted to know in addition, that if this wasnt the case (it wasnt a property) and that only this simple function will work with a browser link (opening a window) then could I write a module or something in access to make the complex javascript, that I want to use, work somehow.
 
Not much clearer... perhaps I need to go to bed!

What is a "windows browser window"? Do you mean Internet Explorer? Or do you mean the "Windows Explorer" that is used by the Windows OS to display local files and folders?

"open()" is a method of the "window" object in the web browser DOM. You can pass a URL to open, via that method.

Or, you can open an empty document, and through JavaScript's document.write() method, dynamically write the contents of that new window. In JavaScript, the code pattern is:

Code:
<script>
var myWindow = window.open("","myWindowName");
myWindow.document.open();
myWindow.document.write("<html>");
<!-- many lines of "write()" to create page -->
myWindow.document.write("</html>");
myWindow.document.close();
</script>

Does that help?



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
HI again,
we are getting much closer. NOw the function I want to use is long, very long. I can put the call function into the access template but it is limited to 255 chars in this field so there is only room for the call function.
Can I make a module to include the large javascript code (that I want to use)and make this call code(in the field of the access database template) call the module to run?
 
HI,
sorry so long to get back. My js script had to be run on the web and I am searching for ones that will just run off desktop server. Thanks for everything and I will try a couple scripts to see If I can learn how to open the file in the application I am writing to. I will have to, experiment. I have an application on my desktop that reads the data in the database and writes it to an HTML page on the desktop. I will try to read some js scripts from the database and see if data goes to the HTML page as I need. The .js file will be kept in a folder outside the database and application called hold. One more thing if I could ask at this point, is there a way to use a js command ie Docmd to have data on an HTML page outside the database read into the fields of the database and formatted just like that of the HTML page. As it is now, if I put data in the database fields in the access template I must put in tags ie <font size="5"> and this is horrably time consuming and I thought if I could read it from the HTML template into the access database template field with a js script that that would samve extreme time and give possibility for larger scripts since fields are limited to 255 chars.
thanks again and if there are anything that doesnt work I will definately get back.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top