Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-06-26
3
Medium Priority
?
144 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
Suggested Courses

618 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