I want my program to do a search on a database every few minutes to check for something specific and if it's found, then to show a certain form. I have 8 forms in my project and I want the search to be done while any of them is open. How do I program a timer to do that every few minutes?

The first time I want it done is 10 sec after the program is opened, where would I put the timer

Recommended Answers

All 4 Replies

Hi,

Place the Timer in any of the Form, and set its "Interval" 10000 (for 10 Seconds)

Write the Checking code in Timer1_Timer Event, Make the Event as Public and u can access it from every where.
If u have a MDI Form, then forst place a Frame Control and place the timer on that frame.

REgards
Veena

Hi,

Place the Timer in any of the Form, and set its "Interval" 10000 (for 10 Seconds)

Write the Checking code in Timer1_Timer Event, Make the Event as Public and u can access it from every where.
If u have a MDI Form, then forst place a Frame Control and place the timer on that frame.

REgards
Veena

Veena, I think he meant not Exactly a timer event. What he wants is when any of his form is activated he wants a search in the database for any change that has happened and report it in another form?. You better get the details. I am confident that he knows the timer event.

put the timer on the MDI forn using any container control and run the search code the timer_timer event at the interval you want.

I put the timer in a separate form which is open as long as the program is running so it's not dependend on which other form is open.
Thank you all for your help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.