?
Solved

Gui guestion about how to temporarily disable the trigger of an event

Posted on 2006-04-10
3
Medium Priority
?
341 Views
Last Modified: 2010-05-01
I have a drop down list box called lstProcess with the following 2 subroutines.

Private Sub DeleteProcess()
..
' Line to disable the call call of lstProcess_click
lstProcess.ListIndex = lstProcess.ListIndex - 1   'This line calls lstProcess_click
' Line to enable the call call of lstProcess_click

...
End Sub

Private Sub lstProcess_Click()
MsgBox("lstProcess_Click")
End Sub

Is there any way to temporarily stop the call of lstProcess_click.

Sincerely,
Celia
0
Comment
Question by:swansonplace
  • 2
3 Comments
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 800 total points
ID: 16418617
you may want to use variable to do so


ie
private notshowclick as boolean

Private Sub DeleteProcess()
..
' Line to disable the call call of lstProcess_click
 notshowclick = true
lstProcess.ListIndex = lstProcess.ListIndex - 1   'This line calls lstProcess_click
notshowclick = false
' Line to enable the call call of lstProcess_click

...
End Sub

Private Sub lstProcess_Click()
if notshowclick = true then exit sub
MsgBox("lstProcess_Click")
End Sub
0
 
LVL 3

Accepted Solution

by:
WillEastbury earned 1200 total points
ID: 16418620
If I were you i'd set form level flag and enclose the event procedure code in an if statement. . .

Private lstProcessclickenabled as boolean
Private Sub DeleteProcess()
..
lstProcessclickenabled = false
lstProcess.ListIndex = lstProcess.ListIndex - 1   'This line calls lstProcess_click
lstProcessclickenabled = true

...
End Sub

Private Sub lstProcess_Click()
if lstProcessclickenabled then
MsgBox("lstProcess_Click")
end if
End Sub
0
 
LVL 3

Expert Comment

by:WillEastbury
ID: 16424563
Well look at that, both posted at the same time !

cool ....
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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

862 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