VB Script problem with Data Access Page 
Author Message
 VB Script problem with Data Access Page


Subject: VB Script Problem With Data Access Page
Date: Tuesday, February 22, 2000 10:24 AM

Hello, my problem is one that an experienced VB programmer will probably
have no problem with.  Here goes.  I have designed a data access page that
allows our users to request accounts from a web form by selecting
information from drop down lists etc.  Once they submit this info it just
has an unchecked box in the database to let us know that they have sent a
request.  I want to make it so that when they click the save records button
it submits an e-mail so we know to go out there and see what needs to be
done.  I wrote a module that works fine.  When I run it in its own
environment it works great, it submits an e-mail to me and everything works
fine.  Here comes the problem.  How do I get this module to execute when I
click the save button?  What I tried to do was to put this:

<SCRIPT event=ButtonClick for=RecordNavigation1 language=VBScript>
<!--
DoCmd.OpenModule [PS Mail]
-->
</SCRIPT>

into the script.  Now this doesn't generate an error or anything, and my
database is still updated fine, but it doesn't submit an e-mail.  What am I
doing wrong, what should I be doing different?  Also, it would be great if
you could tell me how I could get some of the information that they select
from the dropdown boxes into the e-mail.

Thanks a lot,
Aaron



Mon, 12 Aug 2002 03:00:00 GMT  
 VB Script problem with Data Access Page

:
:<SCRIPT event=ButtonClick for=RecordNavigation1 language=vbscript>
:<!--
:DoCmd.OpenModule [PS Mail]
:-->
:</SCRIPT>

Use something like this instead of Docmd as you have it above.

call window.external.Application.Run("YourProcName")

  -- Dev



Mon, 12 Aug 2002 03:00:00 GMT  
 VB Script problem with Data Access Page
Just an FYI that Dev's solution only works if the DAP is being hosted by
Access. Window.External allows you to hook Access's application object as
long as the page is being hosted by Access.

I assume this is the case anyway since you were trying to call
DoCmd.OpenModule. Anyway, if you plan on using the page in IE externally of
Access, then you will need to write Automation code that opens an instance
of Access, opens the database, and then uses the Run method to execute your
proc.

Keith



Tue, 13 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problems with VB script and viewing web pages

2. Problems calling ListView control in HTML page ( VB Script )

3. Problems calling ListView control in HTML page ( VB Script )

4. Problems calling ListView control in HTML page ( VB Script )

5. Accessing Data generated with client-side script from server-side script

6. Passing control from VB to VB Script -- need to access SetFocus in script

7. VB vs Data Access pages

8. VB Data Report Page Orientation Problem

9. VB Data Report Page Orientation Problem

10. Help! Access VB script problems

11. VB Script Problem in access 97 / Module

12. Data Access Pages for Internet access

 

 
Powered by phpBB® Forum Software