Solved

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

Posted on 2006-06-26
3
137 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

920 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