Solved

updating form...

Posted on 2000-02-16
8
127 Views
Last Modified: 2010-05-02
I made a application which deals with a gsm-modem. It receives and sends messages through that modem. I'm also showing all the time in my form how many messages are in a buffer not yet to send. There is also 20 spots in gms-modems memory where it can store the coming messages. My form also shows which places have messages and which don't have (red and green lights).

My problem is that when I'm receiving and sending messages, I try to update those informations in my form (red and green lights) but nothing happens in a form. It could sometimes be quite a long subroutine to send and receive those messages and during that subroutine there could be many changes in a lights. Those lights updates only until my subroutine ends.

So how can I update those lights during my subroutine??

Thanks in advance!
0
Comment
Question by:majala
  • 4
  • 2
  • 2
8 Comments
 
LVL 1

Expert Comment

by:macu
ID: 2526560
Use FormName.Refresh And/Or ControlName.Refresh after each light change.
0
 
LVL 10

Accepted Solution

by:
caraf_g earned 100 total points
ID: 2526561
place the command DoEvents at strategic positions in your code.

Also worth trying: Refresh.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2526563
Photo finish <g>
0
 
LVL 1

Expert Comment

by:jjsc
ID: 2526569
You may also want to try the odd DoEvents() at strategic places in the code. Be aware, though, that DoEvents() can bring its own problems in that your code may (potentially) stop while some other process takes the CPU.

John
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:macu
ID: 2526576
Call it a draw.... :)
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2526646
jjsc right on our heels :o)

"stop while some other process takes the CPU"
I'd hope so! Window's supposed to be "multi-tasking"
0
 
LVL 1

Expert Comment

by:jjsc
ID: 2526673
True, but there are other (less painful) ways to give up the processor - for example, the Sleep API call can be very useful (especially under NT).

Also majala mentioned that one of the update routines could be quite long (with several changes). It may be that executing a DoEvents in the routine is perfectly acceptable (i.e. windows continues to work), but it may also mean that the processing of the function is affected, a side effect that may or may not be important.

And shucks, missed by 1 minute (or 2 maybe :-)

John
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2567964
majala,

Thanks for the points. Next time though, if you feel the answer is less than satisfactory, please ask me for more detail. I'd be happy to help you further in order to get a better grade.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…

746 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

11 Experts available now in Live!

Get 1:1 Help Now