Solved

updating form...

Posted on 2000-02-16
8
133 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
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
 
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

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

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

820 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