Solved

Browser like interface?

Posted on 2004-04-06
4
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Expert Comment

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

Expert Comment

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

Author Comment

by:KC_78
ID: 10769362
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
ID: 10770471
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

729 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