Programing a button in JScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am relatively new to this, I am trying to program a button in jscript. I
want the button to send an e-mail or some notification... how do I do this?
 
Sorry, this newsgroup is for questions about programming in Access, the
database product that's part of Office Professional.

Access uses VBA, not JScript.

You'll need to repost your question to a more appropriate newsgroup.
 
I'm confused. I launched a Access Page, and I'm trying to program a button on
that page. It appears that the language is writen in JScript, but if it can
be written in VBA, I welcome that information too, and I'd be interested to
know how to get VBA to work on an Access Page...

Any help in pointing me in the right direction would be great....
 
AFAIK, Data Access Pages are written in VBScript, not JScript.

There is a newsgroup meant specifically for questions dealing with Access
data access pages (microsoft.public.access.dataaccess.pages), but I'm not
sure you can get to it using Microsoft's web interface (which you appear to
be using). If you can't switch to using an NNTP newsreader (such as Outlook
Express, which you likely already have on your machine: point to server
msnews.microsoft.com), you could try using Google
http://groups.google.com/group/microsoft.public.access.dataaccess.pages/topics

Sorry, but I've got no experience with DAPs, so I can't offer any
suggestions.
 
Hi Jacinda

No you can't use VBA but you can use VBScript.

For example, if you have a Command Button - Command0, you could use
something like:

<SCRIPT language=vbscript event=onclick for=Command0>
VBScript coding goes here
</SCRIPT>

Cheers.

BW
 
Thank you BW, after I posted this I did more digging, and I discovered what
you have shared with me. My only problem is not knowing how to write the
script... I've tried a few different commands but that did not work. Would
you know how to write that?
 
Hi

I know that this is not a subject for this forum but... what the heck!

Short answer is, I'm not sure about emailing direct from the page.

In the past I've achieved what you are looking for by passing the email
content to a server-side ASP page that has no body element and acts, in
essence like an EXE file by -
1. Enclose all relevant fields in a HTML Form tags. e.g. the fields txtTo,
txtFrom, txtSubject, txtContent etc.
2. Set the Forms 'Action' parameter to the ASP page - e.g. <FORM Method=Post
Action="SendMail.asp">
3. Create the SendMail.asp ASP page on the server with content something like:

<%@ language=VBScript %>
<%
Set EMail = Server.CreateObject("CDONTS.NewMail")
From = Request("txtFrom")
SendTo = Request("txtTo")
Subject = Request("txtSubject")
Message = Request("txtContent")

EMail.Send From, SendTo, Subject, Message, 1
set EMail = nothing
Response.redirect("probably to a web page that confirms receipt etc.")
%>

Don't have any Body content for this page so that it doesn't display - i.e.
its actioned on the server only.

Good luck.

BW
 
Back
Top