Microsoft Developer Network >
포럼 홈
>
Visual Basic for Applications (VBA)
>
Open an access vba function in a form using javascript
Open an access vba function in a form using javascript
- Hi,
I have created an access vba function which I now want the ability to call from a SharePoint page via JavaScript. Here's what I have thus far:
The Module's name is Module1 and the function is called test. It appears that everything works OK until line:function test() {
var App = new ActiveXObject("Access.Application")
App.Visible = true;
App.OpenCurrentDatabase("fullPath");
App.Run("Module1!test")
}
Then the problem occurs in the next line:App.Visible = true;
Has someone tackled this before? Thank you!App.OpenCurrentDatabase("fullPath");
BTW, I'm calling the function from a SharePoint page as follows:
<div> <form> <input type="button" value="Click me!" onclick="test()" /> </form> </div>
- 편집됨Condor10101010101 2009년 7월 10일 금요일 오후 11:26
답변
- Hello,
use below test function in your code. and please go through comments. Thanks.
function test()
{
var App = new ActiveXObject("Access.Application")
//use double \\ for path, if required.
var fullPath="C:\\work Station\\Access Group\\Open Access Using Java Script\\OpenAccessUsingJavaScript.mdb";
//first open data base then set property of visible to true.
App.OpenCurrentDatabase(fullPath);
App.Visible = true;
App.Run("test"); // i am calling test procedure, which is public in module, no need to apply module name to call it.
}
Rgrds, Brij http://accessvbadeveloper.wordpress.com- 답변으로 표시됨Condor10101010101 2009년 7월 13일 월요일 오후 5:20
모든 응답
- Hello,
use below test function in your code. and please go through comments. Thanks.
function test()
{
var App = new ActiveXObject("Access.Application")
//use double \\ for path, if required.
var fullPath="C:\\work Station\\Access Group\\Open Access Using Java Script\\OpenAccessUsingJavaScript.mdb";
//first open data base then set property of visible to true.
App.OpenCurrentDatabase(fullPath);
App.Visible = true;
App.Run("test"); // i am calling test procedure, which is public in module, no need to apply module name to call it.
}
Rgrds, Brij http://accessvbadeveloper.wordpress.com- 답변으로 표시됨Condor10101010101 2009년 7월 13일 월요일 오후 5:20
- Thank you VBA - Developer! Adding the extra slash to my path did the trick! Appreciate your help!

