Results 1 to 11 of 11
  1. #1
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60

    Application.Echo doesnt seem to be working


    Hello'

    Just typed up a quick non descript example of what I'm doing here...
    e.g.
    Application.Echo false
    DoCmd.Hourglass true

    subform.visible = true
    subform.recordsource = "query"
    if forms!subform.form.field1 = criteria = true then

    forms!subform.form.field2.visible = false
    forms!subform.form.field3.visible = true
    me.field3.controlsource = "query"

    forms!subform.form.CommandButton1.Visible = true
    forms!subform.form.
    forms!subform.form.CommandButton1.setfocus
    forms!subform.form.CommandBUtton2.visible - false

    Application.Echo True
    DoCmd.Hourglass False


    App works fine / does everything its supposed to do, except the screen repaints / flashes for almost every action (no matter if its visibility, enabled, record or control sources... everything) despite using the application.echo property.

    Am I doing something wrong here?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have never used the Echo method before. I had to look it up. It is probably all of the .Visible property settings that is causing the flashing and blinking. Maybe you can use a Pop-Up form that displays a message or simply covers up the Main Form while your code works.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    why not just put the subform.visible=true at the end, followed by the setfocus (you can only setfocus on visible controls), then you wouldn't need the application.echo

    Also, found this link - see post #12, relates to docmd.echo, but may work for you

    http://www.access-programmers.co.uk/...d.php?t=172987

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Ajax View Post
    why not just put the subform.visible=true at the end...
    The OP has one SetFocus method that would need to go after that ....

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I did say that

    why not just put the subform.visible=true at the end, followed by the setfocus (you can only setfocus on visible controls)

    Besides the OP's code is made up, it wouldn't run as is anyway

  6. #6
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60
    I tried the workaround (loading a "Wait for it" form in front of the app forms while they do their thing; (setting record sets, control sources, visibility, locked states etc)).
    I replaced all my ECHO settings with this form for test purposes.
    IN either scenario these are the first and last lines of code in the SUBs.

    I rarely ever actually get to see the form though as the code runs too quick. It seems that most of the functions are still completed in milliseconds however on the more complex forms, the objects will still 'waterfall' into view in lieu of all at once (only takes a few milliseconds).

    This is usually only really noticeable the first time the form is loaded in the session. Subsequent loads can be almost instantaneous.
    Switched back to the ECHO method and I find that the waterfall effect is a little worse than without.

    Neither scenario provided with every object being displayed simultaneously.
    They always display according to the which line comes first in the code regardless of using the Echo method or displaying a form before and after all the code runs.

    So, I presume there is some on screen drawing order that is occurring regardless of how it is coded?
    Or some method that Access uses to cache the forms in the session? Or something else I am not aware of?

  7. #7
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    just a thought - where is the code called from? if from the main form current event, this event is called multiple times - basically once for each subform

  8. #8
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60
    being called from subforms from command buttons. much in reference to modules (modulized whatever I could)

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would have expected the Visible property thing to work, as Ajax mentioned.

    Perhaps Ajax is eluding that the calls from another module are contributing to the flickering.

    Here are approaches I have used in the past ...
    Use a pop-up form as mentioned
    Use the Visible property of the SubForm as mentioned
    and
    Use an opaque rectangle and adjust its Visible property using code. I right click the rectangle to bring it forward and match its color to the background.

    Otherwise, I rethink my design and use additional (new) forms.

  10. #10
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    things like

    subform.recordsource = "query"

    will trigger a current event.

    Suggest you step through the code to see if the code is called more than once (or put debug.print me.name before the application.echo false line) - you may find you are setting echo from false to true and back to false again multiple times.

  11. #11
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60
    I did essentially as ItsMe suggested.

    Added a new subform "COVERFORM" with no relationship and brought it to the front of everything else on the form.
    Then substituted every Application.Echo False with the COVERFORM.visible = True and vice versa for Application.Echo True.

    I rarely ever actually see the COVERFORM because the code runs in only a few milliseconds, however I can tell its there and displayed as I do not see the "flashing" screen effect for the few milliseconds it takes to run the code.
    No seizures for the end users

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Echo On- Echo Off
    By LeonS in forum Programming
    Replies: 2
    Last Post: 07-10-2014, 08:25 AM
  2. Replies: 4
    Last Post: 04-22-2014, 12:36 PM
  3. application minimization is not working
    By joshynaresh in forum Access
    Replies: 13
    Last Post: 12-12-2013, 12:47 PM
  4. docmd.echo
    By jlgray0127 in forum Forms
    Replies: 1
    Last Post: 04-17-2013, 01:28 PM
  5. Echo on/off
    By nigel brown in forum Access
    Replies: 3
    Last Post: 12-08-2010, 08:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums