Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form not updated?

Status
Not open for further replies.

Aietoe

Technical User
Nov 30, 2000
85
CA
Hi,

Using Access 97, i call a macro from a form that does the following:

1- Make a control invisible on that form;
2- Call Word for a mail merge.

When i run tha macro step by step, the control becomes invisible whitout any problems.

When i run it regulaly, the control stays visible.

Why is that?

Aietoe[ponder].
 
Asynchronous processing. Test it for us: Take the call to Word out of the macro and see if it makes the form invisible then.

If it does, you'll know it's because Access is making the control invisible, then kicking off the Word application and going through all that stuff, before it's coming back and UPDATING your screen image with the new form buffer.

Most visual changes to forms won't become "visible" until after all the other processes that may be in the same procedural precedence stack finish off.

I think if you do this, it might work:

Form!Control.Visible = FALSE
Form.REPAINT
DoCmd.CallWordAndStartUPMailMerge...





Remember, you're unique - just like everyone else
You're invited to visit another free Access forum:
or my site,
 
Hi Jim,

Effectively, Access does make the control invisible....
and then i call Word....
and then since i want the control visible again after Word has finished, i have a command in my macro that make the control visible...
I think that every thing is working fine except taht Access doesn't wait until Word has finished and continue the processing of the macro.... and makes the control visible immediatly so fast that i don't even see it dissaper.. :eek:(

Is there a way to make Access wait until Word has finished?

Thanks

Aietoe[ponder]
 
Ahhahh! - you didn't mention the making it VISIBLE again part - but that proves my point.

1- Control Invisible
2- Call WordMailMerge (Windows Kernal kicks off a new thread...continue with next line of code:
3- Control Visible

It's kinda hard to keep Step 3 from happening right away, because of the aformentioned asynch processing. I don't know for sure, but you may need to set up some kind of monitor loop with a DoEvents in it to check and see if the word process is finished, before you go on. There are undoubtably others here with more specific and correct suggestions.

You've encountered a fact of life in the multi-tasking event driven world. Things don't happen in a linear fashion.

Remember, you're unique - just like everyone else
You're invited to visit another free Access forum:
or my site,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top