Solved

Waiting for a response

Posted on 2000-03-17
5
142 Views
Last Modified: 2010-05-02
My next problem. I have a loop that processes data file. When I find a "bad" record I want to put that data in a grid, allow for editing it and have the user click a button to accept or reject the edits. The grid and buttons are hidden on the form until I am ready for the user. Problem is, I populate the grid and then my program goes along and processes the rest of the data. How can I have the process wait for one of the buttons on the form to be pressed and then keep going?  All of the unhiding and populating is happening in a sub called FixData
0
Comment
Question by:scotts27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 100 total points
ID: 2628525
Well, you could pull the grid and buttons out of your current form and put them on another form.

Then when you run into a bad record, populate the grid on this new form and show it like this:

    NewForm.Show 1

That way, your processing will stop until the user edits the item and clicks a button...  The button they click needs to hide the newform so processing can continue...


Cheers!®©
0
 
LVL 9

Expert Comment

by:Dalin
ID: 2628624
or you can do something like:
'code for process data
'Somekind of loop
  ' If data problem
 'Put it in grid
' Show the grid and botton
      Do while GridControl (or Botton).Visiable = True
                   DoEvents
            Loop
    ' continue to process  
'end of loop.

However, mcrider's suggestion is a cleaner way of doing it, unless you have something else going on at the sametime
0
 

Expert Comment

by:rnshaw
ID: 2628638
Well looks like i read this one too late, hehe. The above answers are both exactly what you would do. I would recommend #1 if you dont need to go away from that form, but #2 allows you to open a different form, since adding the 1 after the .show causes the form to become modal.
0
 

Author Comment

by:scotts27
ID: 2628720
Thanks! Once again, I was on the right track but had no idea about the 1 on the end to make it modal.. Perefect.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2628792
Yea, you can use the 1 to make it modal, or you can use the keyword VbModal, which is equal to 1.

Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

624 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