Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
| Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 9th, 2006, 08:15 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem using ADO to open form in MS Access

I am new to VBScript so please bear with me. I have a script that runs a report and updates a MS Access table. The script uses 6 InputBoxes to get selection criteria from the user. I would like to use a single dialog box for the user to enter the selection criteria. If anyone has experience with this, your advice is welcome. (please include some code if you have a suggestion). To continue, I've designed an Access Form with the thought that the script can open the form, allow the user to enter selection criteria, then save the selections to a single record in the table. Then the script can read that record to get the selection criteria to run the report. However, I need some help with this process from opening the form to having a button to save the selection criteria. Anyway, I have the following code just to open the form but will not execute the openform command. Any assistance would be greatly appreciated.

Option Explicit
Dim cnDB
Set cnDB = CreateObject("ADODB.Connection")
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "User ID=Admin;Password=;Data Source=" & _
    "C:\testdb.mdb"
cnDB.Open
DoCmd.OpenForm "testform"
MsgBox "form test complete"
Reply With Quote
  #2 (permalink)  
Old May 1st, 2006, 06:23 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Did you get this resolved? Now is the time to learn VB.NET. VBScript can't do what you want with the form design.

An alternative (not a good one) is to use a web page form instead of calling the form from Access (which is very problematic.) Let me know if you still need help on this.



mmcdonal
Reply With Quote
  #3 (permalink)  
Old May 1st, 2006, 10:53 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First... Thank you for responding mmcdonal. It really is appreciated.

I would like a method to get input from a user rather than using all the input boxes. I am using this with SAP (ERP system 4.7) which has a vb script recorder and playback capability. I'm just taking it a bit further and need a method to get user input. So any help or suggestions you could offer would be welcome. I have created a htm form but do not know much about getting the data from the form into an access database or as variables the script can access. If you have knowledge on this and are willing to share it, you have my ear.

Thanks again.

Reply With Quote
  #4 (permalink)  
Old May 2nd, 2006, 06:25 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

We may have to research this together. I just got "Advanced VBScript for Microsoft Windows Administrators" from MSPress (ISBN: 0735622442) to cover this issue, among other things. It is a follow on book to "Microsoft Windows 2000 Scripting Guide" (ISBN: 0735618674). Both of these books are essential, and they are the only references you will ever need for vb scripting.

See: http://www.amazon.com/gp/product/073...Fencoding=UTF8

And: http://www.amazon.com/gp/product/073...Fencoding=UTF8

Wrox has some good books on scripting, but they tend to be references on syntax, and you have to know how to put stuff together to use them properly. I have them too.

Anyway, there is a chapter in the advanced book on creating HTA's for just the sort of thing you are trying to do here. I have just started reading that chapter. I will have to go over it and then get back to you with some questions to get this working. I know you can make the very interface you are looking for for your application. They show you how to make it look very professional. See the scripting guys page on MS for their Scriptomatc hta, which is IE repackaged to look like a VB application. It is very cool. I hope you have time for all this.

HTH

mmcdonal
Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
OPEN A FILE DIALOG IN MS ACCESS 2000 DevineRule BOOK: Beginning ASP 3.0 3 January 28th, 2010 07:59 AM
ado.net and ms access owoade .NET Web Services 1 August 31st, 2007 08:45 PM
ADO Connection between 2 MS Access Database Scripts82 Access VBA 2 February 8th, 2006 02:35 AM
Open external DB in MS Access VB problem Derek_05 Access VBA 1 January 21st, 2006 03:51 AM
Backup an open access database (ado) jolzy VB Databases Basics 0 October 27th, 2004 09:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.