473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to get form to display first, then run code on open?

I have a popup form that has Start and Stop buttons to initiate a search for
email messages. If the user's Inbox has thousands of messages, the Stop
button will gracefully end the search without making the user wait for the
search to complete. The form has an option to "start searching when form
opens", so the user can take the default search parameters and start the
search without having to click the Start button.

The problem is the form does not display until the search is complete. So
the stop button is not available and users are left staring at an hourglass
as the search runs.

I've tried this:

Private Sub Form_Load()
If m_blnSearchOnOpen Then
DoEvents
Call cmdStart_Click
End If
End Sub

but no luck.

How can I get the form to display first, then run the code behind the start
button?

Thanks in advance.

Jan 25 '06 #1
2 9945
On Tue, 24 Jan 2006 19:20:12 -0800, "deko" <de**@nospam.com> wrote:
I have a popup form that has Start and Stop buttons to initiate a search for
email messages. If the user's Inbox has thousands of messages, the Stop
button will gracefully end the search without making the user wait for the
search to complete. The form has an option to "start searching when form
opens", so the user can take the default search parameters and start the
search without having to click the Start button.

The problem is the form does not display until the search is complete. So
the stop button is not available and users are left staring at an hourglass
as the search runs.

I've tried this:

Private Sub Form_Load()
If m_blnSearchOnOpen Then
DoEvents
Call cmdStart_Click
End If
End Sub

but no luck.

How can I get the form to display first, then run the code behind the start
button?

Thanks in advance.


In the Open event put the following lines.

DoCmd.SelectObject acForm, Me.Name
Me.Repaint
DoEvents

Wayne Gillespie
Gosford NSW Australia
Jan 25 '06 #2
> In the Open event put the following lines.

DoCmd.SelectObject acForm, Me.Name
Me.Repaint
DoEvents


That did the trick! Thanks!

I love simple solutions...
Jan 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve | last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's criteria is set ats: Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the selections are 30, 60...
2
by: neptune | last post by:
I built a form to access a query with a 2 field primary key. It should use 2 controls to find the unique record and display the other field values on the form. In the criteria section of the...
15
by: Paul T. Rong | last post by:
Hi everybody, This time a very very difficult case: I have a table "tblStudent", there are 50 students, I also made a form "frmStudent" based on "tblStudent", now if I don't want to show all...
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
2
by: kev | last post by:
Hi Folks, I have created a search query in which it successfully returns correct results. When there are no records returned, instead of giving out a blank form i created a pop-up msg which is...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.