Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…

803 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