Solved

Waiting for a response

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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 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…

705 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

14 Experts available now in Live!

Get 1:1 Help Now