| Database Programming Techniques > Postponing Illegal Operations in List Events |
During most of the list events, database and other system operations are still pending, and certain operations are not allowed within these list events. To circumvent such limitations, you can use the PostMsg method in conjunction with the PostEvent event to postpone operations which are illegal within the list events. If the PostMsg method is called, the list will fire the PostEvent event with the MsgId of the corresponding PostMsg invocation after all pending operations are completed. You can then safely perform all desired operations in the PostEvent event.
Please note that execution of the Visual Basic DoEvents function will cause the Windows message queue to be processed, thus causing execution of the PostEvent events before the DoEvents returns.