Solved

If I have commands indexed command44(3) command44(4) can I add different code to each?

Posted on 2006-06-26
3
142 Views
Last Modified: 2010-04-30
Hi

I have an application where to have enough controls on a form I have similar functions on the same command number indexed. Command 44 for example always shows the same code and I have about 10 that are the same command44(1) command44(2) etx.

I need a part of the code to vary for each indexed command is there a way todo this?

I have indexed the command as my vb form has long since exeeded the maximum number of controls for a form
0
Comment
Question by:eneate
[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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
JackOfPH earned 500 total points
ID: 16982649


yes !
put this on the click event()


Select case index

Case 1
msgbox "Command button with index of 1 was clicked"
case 2
msgbox "Command button with index of 2 was clicked"

Case 3,4
msgbox "Command button with index of 3 and 4 has the same code"
case 5 to 44
msgbox "Command button with index of 5 to 44 has the same code"

end select



0
 

Author Comment

by:eneate
ID: 16982723
Sorry I don't quite follow

This is the code I have in the click event
If enable_audit_trail = True Then

If read_frm_open = True Then
ret = IpWsUndo(2)

If enable_audit_trail = True Then

   frmaudit.txtprocess.text = text(2224) '"Undo Banknotes Enhance
   write_audit_trail
        End If
       
ElseIf read_frm_open = False Then
frmaudit.Show
Wait 1
ret = IpWsUndo(2)
If enable_audit_trail = True Then
   frmaudit.txtprocess.text = text(2224) '"Undo Banknotes Enhance
   write_audit_trail
        End If
End If

ElseIf enable_audit_trail = False Then
ret = IpWsUndo(2)
End If

I need the text(2224) to change depending on the index of the command.
0
 

Author Comment

by:eneate
ID: 16982771
Hi

Got it, must be the rain on the tihnking stufff. Thanks for the feedback
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

728 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