Solved

Browser like interface?

Posted on 2004-04-06
4
158 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 44
message box in access 4 51
Copy a row 12 64
MsgBox 4 68
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 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