Solved

Waiting for a response

Posted on 2000-03-17
5
139 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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