Solved

Browser like interface?

Posted on 2004-04-06
4
155 Views
Last Modified: 2011-09-20
Hi, hope you can help me with this VBA enhancement.  I am working on a project using the application PI.  It utilizes VBA similarly to Excel etc.

This is the situation, I have a main page and there are rectangular boxes that when I click on, will take me to a "display" (graph or trend).  Right now, I have like 12 boxes, and I am naming all 12 boxes and creating a click event for each.  i.e.

"Public Sub SCV_Phos_Abs_Lnk_Click(ByVal lvarX As Long, ByVal lvarY As Long)
    LinkTo "SCV Trends", "Phos_Abs_Hi_Press"
End Sub
----------
Public Sub SCV_Phos_Abs_Lnk_MouseOut()
    SCV_Phos_Abs_Lnk.LineStyle.Weight = 1
    SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 0)
End Sub
-------------
Public Sub SCV_Phos_Abs_Lnk_MouseOver()
    SCV_Phos_Abs_Lnk.LineStyle.Weight = 2
    SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 255)
End Sub"

where "LinkTo" is a procedure I created, and "SCV Trends is the name of the display page and "Phos_Abs_Hi_Press" is the name of one of the 12 displays on that page.

Instead of having 12 of those, is there a way to generalize the code and make it like kinda web browsing.......where I don't have to name each link?

Thanks!

0
Comment
Question by:KC_78
  • 3
4 Comments
 
LVL 8

Expert Comment

by:dds110
Comment Utility
Have you tried using buttons with a hyperlink property?
0
 
LVL 8

Expert Comment

by:dds110
Comment Utility
Better question is what program are you working in?  Access, Word, Excel, Powerpoint, etc...?
0
 

Author Comment

by:KC_78
Comment Utility
As I mentioned, PI.  It is by a company called OSISoft.  It is a datamining program.  It collects plant data out in the field and sends it back to the client (me).  I am developing screens and stuff like that, information to be pulled etc.....

The problem with this program is that it's little drawing display interface is not very powerful.  You can make a symbol (button, box, circle etc..) scriptable and then you can name it and write scripts using VBA.

Is this clearer?
0
 
LVL 8

Accepted Solution

by:
dds110 earned 125 total points
Comment Utility
The only thing I can think to do (since I've never seen this program) is to create a function that accepts some argument that references the button clicked.  In this function, you could write a Select Case statement.  You will still have 12 separate functions for each button in order to call the Select Case Function.

Or perhaps the program will let you create control arrays (still have to have the select case function).

Sorry I couldn't be more help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now