Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Comand button with macro on MS Access Web Page?

1 view
Skip to first unread message

T@discussions.microsoft.com Emily T

unread,
Oct 3, 2008, 8:09:00 PM10/3/08
to
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.

Ken Snell (MVP)

unread,
Oct 4, 2008, 11:01:22 AM10/4/08
to
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" <Emily T...@discussions.microsoft.com> wrote in message
news:C8BAA309-A186-472C...@microsoft.com...

Emily T

unread,
Oct 5, 2008, 10:11:01 AM10/5/08
to
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)

unread,
Oct 6, 2008, 10:19:58 PM10/6/08
to
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" <Emi...@discussions.microsoft.com> wrote in message
news:3FAA6D55-F91B-4AA2...@microsoft.com...

0 new messages