?
Solved

Delay running query

Posted on 2005-05-06
4
Medium Priority
?
290 Views
Last Modified: 2008-03-03
I have a combo box that when I select and index I need it to wait until Textbox 2 is REpopulated with the new value before it fires.  How can I accomplish.


   Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
 *******************************
   need to wait until textbox 2 is populated.
         Me.RunQuery()
    End Sub

Thanks
0
Comment
Question by:running32
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 2000 total points
ID: 13947661
in Textbox2 Change event add global boolean var that you will set to true on change event. then

  Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
 *******************************
if bool = True then
  bool = False
         Me.RunQuery()
end if
    End Sub

0
 

Author Comment

by:running32
ID: 13959192
Can you tell me what you mean by setting the global bolean to var.  When I add this statement I get runtime errors on bool.

Thanks
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 13959247
you memorize the repopulation of textbox2 and run query only if it happened
0
 

Author Comment

by:running32
ID: 13959263
Got it.  Thanks for the help iboutchkine.  

I changed it to the code below and it works great......

 Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged

        bool = True
     
    End Sub

 
    Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
        If bool = True Then
            bool = False
            Me.RunQuery()
        End If
    End Sub
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

807 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