Comand button with macro on MS Access Web Page?

E

Emily T

What do I need to do to be able to have a command button on a MS Access web
page utilize a macro? There is no "ONCLICK" property for the command button!

If macro is not possible what do I need to put before and after my Visual
Basic code that would go within the HTML code? When I try to paste my VB
code I get error messages; I think because of the [/script] commands that are
already there.

Any help would be appreciated.
 
K

Ken Snell \(MVP\)

You cannot call a macro from a Data Access Page (web page). You will need to
program the button with Visual Basic Script directly in the Page.
 
E

Emily T

Ok.
I know the Visual Basic code that makes my macros work. But when I paste the
VB code within the code of the web page it does not work.

What do I need to type, or delete, so that the VB code is accepted? For
example do I need to preface my vb code for the macros with something so the
page knowes its Visual Basic?

Thanks!

Ken Snell (MVP) said:
You cannot call a macro from a Data Access Page (web page). You will need to
program the button with Visual Basic Script directly in the Page.
--

Ken Snell
<MS ACCESS MVP>



Emily T said:
What do I need to do to be able to have a command button on a MS Access
web
page utilize a macro? There is no "ONCLICK" property for the command
button!

If macro is not possible what do I need to put before and after my Visual
Basic code that would go within the HTML code? When I try to paste my VB
code I get error messages; I think because of the [/script] commands that
are
already there.

Any help would be appreciated.
 
K

Ken Snell \(MVP\)

Data Access pages use events, similarly to forms and reports in normal
ACCESS.

However, the syntax that identifies a VBScript procedure is different. The
procedure goes in the Body of the code behind the page.

(1) The first lines of a procedure for the Click event of a button
are this:

<SCRIPT language=vbscript event=onclick for=btnCancel>
<!--

In the above, btnCancel is the name of the button so replace that with the
real name of your command button.


(2) The last lines of a procedure are these:

-->
</SCRIPT>

The script steps go between these "first" and "last" lines.
--

Ken Snell
<MS ACCESS MVP>





Emily T said:
Ok.
I know the Visual Basic code that makes my macros work. But when I paste
the
VB code within the code of the web page it does not work.

What do I need to type, or delete, so that the VB code is accepted? For
example do I need to preface my vb code for the macros with something so
the
page knowes its Visual Basic?

Thanks!

Ken Snell (MVP) said:
You cannot call a macro from a Data Access Page (web page). You will need
to
program the button with Visual Basic Script directly in the Page.
--

Ken Snell
<MS ACCESS MVP>



Emily T said:
What do I need to do to be able to have a command button on a MS Access
web
page utilize a macro? There is no "ONCLICK" property for the command
button!

If macro is not possible what do I need to put before and after my
Visual
Basic code that would go within the HTML code? When I try to paste my
VB
code I get error messages; I think because of the [/script] commands
that
are
already there.

Any help would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top