Comand button with macro on MS Access Web Page?

  • Thread starter Thread starter Emily T
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
Back
Top