• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

DoCmd.Echo not working

In my access  application, I have a button to call a batch file. Since it will take some time to finish the process, I added DoCmd.Echo True, "Creating Job folders...".But for some reason it is not showing up in the status bar.
Here is the code

DoCmd.Echo True, "Creating Job folders..."
' REM  Application.Echo True, "Creating Job folders..."

Call Shell CreateJob.bat

Can you tell me why
0
aio419
Asked:
aio419
1 Solution
 
jjafferrCommented:
to write to the status bar use:

-- To Set The Message -------------
Call SysCmd(acSysCmdSetStatus, "HI THERE!!")

-- To Clear The Message -----------
Call SysCmd(acSysCmdClearStatus)

0
 
Rey Obrero (Capricorn1)Commented:
try

DoCmd.Echo True, "Creating Job folders..."
DoEvents      '<<< add this line
0
 
aio419Author Commented:
jjafferr ,that is cool! You are an expert!

just for my information
Can you explain why the DoCmd.Echo True, "Creating Job folders..." did not work.
It is working everywhere else.

It shows there for a fraction of a second in the taskbar and gone .
I tried doevents also
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
jjafferrCommented:

because the code finished executing :o)
because you used shell, the code will pass the task to the processor, but will not wait for it to finish.

if however you want the code wait until the shell is finished, then you should use:
http://www.mvps.org/access/api/api0004.htm

jaffer
0
 
puppydogbuddyCommented:
I think it will work if you use the Application object instead of the DoCmd object as follows:

Private Sub XXXXX()  
 
Application.Echo False  
 
DoCmd.Hourglass True  
 
...................your code........
 
Application.Echo True  
 
DoCmd.Hourglass False  
 
End Sub
0
 
aio419Author Commented:
Thanks guys for all the info.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now