Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
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 February 21st, 2008, 04:52 AM
Registered User
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default referring to the active project

Hi!

I am a student who is writing her Thesis. And I need to program a button in Manifold (I do not know whether have you heard about this program before. It is a G.I.S. one).

The aim of this button is to show the result of a SQL query. And this part I got. What I need to get now is, since this button appears everytime you lunch the programm by default. And if the project where the query and tables needed is not the current one it leads to an error. Then I need the button to get which is the active project and if this is not the right one, then display a box and do not execute the query.
But, as I do not have so much knowledge about programming, I do not know how to make the script get the active project name and then, if it is not the right one,display the box.

Here you have the button programmation just in case you want to have a look at it :)

Sub Main
Set doc = Application.ActiveDocument
set project = doc.Name
if project <> "Copia de room" then
MsgBox " Necesitas abrir el proyecto"
exit sub
end if
set Comps = Document.ComponentSet
if Comps.ItemByName ("kk")< False then
set Qry = Document.NewQuery ("New Query")
else
set Qry = Comps.Item ("kk")
end if
Qry.Text = "select [Rooms].[room_name],[places],[Rooms].[Use],[user],[Address].[street] from [Rooms]" &_
         "inner join [Room]" &_
             "inner join [Address]" & " on [Room].[building] = [Address].[building]" &_
         "on [Rooms].[room_name] = [Room].[room_id]" &_
 "where [places]>30 and [places]<100"
Qry.RunEx True
set table = Qry.Table
Qry.Table.Open
    End Sub


where "Copia de room" is the project name containing the query and tables.

Thank you very much!!

Arantxa

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
referring methods from different project in VS ajindal General .NET 1 August 17th, 2006 05:42 AM
Check the referring page and decide on opening a n pkballa Javascript 1 March 29th, 2006 02:02 AM
Referring to a field and updating Programmatically vmerc Access VBA 4 January 12th, 2006 10:28 AM
How to check referring page? Dave Brown Beginning PHP 6 February 7th, 2005 12:01 PM
Referring to a Subform mikericc Access 1 April 9th, 2004 04:50 PM





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