Solved

Is it possible to stop temporarily a event?

Posted on 2002-03-28
2
207 Views
Last Modified: 2010-05-02

.  I would like stopping a event when I fill a another control box (combo box, list box....) because VB makes a event when my combo is modified. Each time, VB launches the codes which is to link to event.


Is it possible ?
0
Comment
Question by:zoltix
2 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 6903677
You cannot stop the event.  You can however trap certain instances of the event.

Option Explicit
Private mbSel As Boolean

Private Sub Form_Load()
    Dim i As Integer

    For i = 1 To 3
        List1.AddItem "item " & i
    Next i
   
'    by setting this flag we ingnore click event from selecting item
    mbSel = True
    List1.ListIndex = 0
    mbSel = False
    'after selecting we can now capture the clicks generated by the mouse
   
End Sub

Private Sub List1_Click()
    'if the variable is true, then we want to ignore event.
    If mbSel Then Exit Sub
   
    Debug.Print "click " & List1.List(List1.ListIndex)
End Sub
0
 
LVL 1

Accepted Solution

by:
daniellyh earned 50 total points
ID: 6904462
yes i think this should be the way to skip the event in certain conditions.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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 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…

760 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

22 Experts available now in Live!

Get 1:1 Help Now