Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

743 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

15 Experts available now in Live!

Get 1:1 Help Now