473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create Message in Status bar

Hi All

Please can anyone advise whether it is possible to display messages in
the status bar.

I have a number of update queries which will be run and need to find a
way to identify which field is currently being updated so that I can
monitor the progress.

I know that I can use InputBox to display the variable table and field
names, but do not want to be prompted to confirm each time, so hope that
it is possible to display this in the status bar without interrupting
the processing.

This is the code :-

Function ReplaceCurrency()
DoCmd.SetWarnings False

On Error GoTo Error

Static dbs As Database, rst1 As Recordset, rst2 As Recordset, rst3 As
Recordset, strSql1 As String, strSql2 As String, strSql3 As String
Dim VPlan As Long
Dim VRec, VRec3 As Long
Dim tblCurrent As TableDef
Dim intCounter As Integer
Dim vFlag As String
Dim strField, strTable, strSql, strXref As String

Set dbs = CurrentDb

strSql1 = "SELECT tblFields.FileCode, tblFields.TableName,
tblFields.IsamFieldName, tblFields.ColumnName, tblFields.Description " &
_
"FROM tblFields;"

strXref = "tblXrefAlrode"
'"tblXrefElands"
'"tblXrefMidrand"
'"tblXrefUtilities"
'"tblXrefHoldings"

Set rst1 = dbs.OpenRecordset(strSql1)
If rst1.RecordCount 0 Then
rst1.MoveFirst
strTable = "dbo_" & rst1!TableName
strField = rst1!ColumnName

strSql = "UPDATE " & strTable & " INNER JOIN " & strXref & " ON " &
strTable & "." & strField & " = " & strXref & ".Old SET " & strTable &
"." & strField & " = " & strXref & "![New];"
DoCmd.RunSQL "UPDATE " & strTable & " INNER JOIN " & strXref & " ON
trim(" & strTable & "." & strField & ") = " & strXref & ".Old SET " &
strTable & "." & strField & " = " & strXref & "![New];", 0

NextRec:
rst1.MoveNext

While (Not (rst1.EOF))
strTable = "dbo_" & rst1!TableName
strField = rst1!ColumnName
strSql = "UPDATE " & strTable & " INNER JOIN " & strXref & " ON " &
strTable & "." & strField & " = " & strXref & ".Old SET " & strTable &
"." & strField & " = " & strXref & "![New];"
DoCmd.RunSQL "UPDATE " & strTable & " INNER JOIN " & strXref & " ON
trim(" & strTable & "." & strField & ") = " & strXref & ".Old SET " &
strTable & "." & strField & " = " & strXref & "![New];", 0
rst1.MoveNext
Wend

End If
rst1.Close
DoCmd.OpenQuery "updDescription", acViewNormal

MsgBox "All Done - Thank You"
Exit Function

Error:
MsgBox Err.Description
strTable = InputBox("Table Name", , strTable)
strField = InputBox("Field Name", , strField)
strSql = InputBox("String", , strSql)
Resume NextRec

End Function

Thanks for your interest.
Laetitia

*** Sent via Developersdex http://www.developersdex.com ***
Aug 13 '08 #1
5 13092
Dim s As Variant

s = SysCmd(acSysCmdSetStatus, "Some Message") ' Display message

.....

s = SysCmd(acSysCmdClearStatus) ' Clear the message
ps
Why not use currentdb.execute instead of DoCmd.RunSQL?
"Laetitia" <no****@devdex.comwrote in message
news:12**************@news.newsfeeds.com...
Hi All

Please can anyone advise whether it is possible to display messages in
the status bar.

I have a number of update queries which will be run and need to find a
way to identify which field is currently being updated so that I can
monitor the progress.

I know that I can use InputBox to display the variable table and field
names, but do not want to be prompted to confirm each time, so hope that
it is possible to display this in the status bar without interrupting
the processing.

This is the code :-

Function ReplaceCurrency()
DoCmd.SetWarnings False

On Error GoTo Error

Static dbs As Database, rst1 As Recordset, rst2 As Recordset, rst3 As
Recordset, strSql1 As String, strSql2 As String, strSql3 As String
Dim VPlan As Long
Dim VRec, VRec3 As Long
Dim tblCurrent As TableDef
Dim intCounter As Integer
Dim vFlag As String
Dim strField, strTable, strSql, strXref As String

Set dbs = CurrentDb

strSql1 = "SELECT tblFields.FileCode, tblFields.TableName,
tblFields.IsamFieldName, tblFields.ColumnName, tblFields.Description " &
_
"FROM tblFields;"

strXref = "tblXrefAlrode"
'"tblXrefElands"
'"tblXrefMidrand"
'"tblXrefUtilities"
'"tblXrefHoldings"

Set rst1 = dbs.OpenRecordset(strSql1)
If rst1.RecordCount 0 Then
rst1.MoveFirst
strTable = "dbo_" & rst1!TableName
strField = rst1!ColumnName

strSql = "UPDATE " & strTable & " INNER JOIN " & strXref & " ON " &
strTable & "." & strField & " = " & strXref & ".Old SET " & strTable &
"." & strField & " = " & strXref & "![New];"
DoCmd.RunSQL "UPDATE " & strTable & " INNER JOIN " & strXref & " ON
trim(" & strTable & "." & strField & ") = " & strXref & ".Old SET " &
strTable & "." & strField & " = " & strXref & "![New];", 0

NextRec:
rst1.MoveNext

While (Not (rst1.EOF))
strTable = "dbo_" & rst1!TableName
strField = rst1!ColumnName
strSql = "UPDATE " & strTable & " INNER JOIN " & strXref & " ON " &
strTable & "." & strField & " = " & strXref & ".Old SET " & strTable &
"." & strField & " = " & strXref & "![New];"
DoCmd.RunSQL "UPDATE " & strTable & " INNER JOIN " & strXref & " ON
trim(" & strTable & "." & strField & ") = " & strXref & ".Old SET " &
strTable & "." & strField & " = " & strXref & "![New];", 0
rst1.MoveNext
Wend

End If
rst1.Close
DoCmd.OpenQuery "updDescription", acViewNormal

MsgBox "All Done - Thank You"
Exit Function

Error:
MsgBox Err.Description
strTable = InputBox("Table Name", , strTable)
strField = InputBox("Field Name", , strField)
strSql = InputBox("String", , strSql)
Resume NextRec

End Function

Thanks for your interest.
Laetitia

*** Sent via Developersdex http://www.developersdex.com ***

Aug 13 '08 #2
rkc
On Aug 13, 2:54 pm, Laetitia <nos...@devdex.comwrote:
Hi All

Please can anyone advise whether it is possible to display messages in
the status bar.

I have a number of update queries which will be run and need to find a
way to identify which field is currently being updated so that I can
monitor the progress.

I know that I can use InputBox to display the variable table and field
names, but do not want to be prompted to confirm each time, so hope that
it is possible to display this in the status bar without interrupting
the processing.

This is the code :-
<snip>

SysCmd acSysCmdSetStatus, "Look a status bar! Didn't know that was
there."

writes to the status bar. You probably won't see much more than the
last
text sent though. If I wanted to monitor something like that I would
consider writing the info to a textbox on the form the code is run
from.
You'd probably have to call Repaint after each write to see it before
the
loop ends though.


Aug 13 '08 #3
Hi Ron.

Thanks. I will give it a bash.

ps
Why not use currentdb.execute instead of DoCmd.RunSQL?

Force of habit, I guess. Old dogs do not learn new tricks too easily :)

*** Sent via Developersdex http://www.developersdex.com ***
Aug 13 '08 #4

Hi rkc.

Thanks. I am running the code from a macro, but will consider creating a
form as you suggested.

Thanks again.
*** Sent via Developersdex http://www.developersdex.com ***
Aug 13 '08 #5
Hi again, rkc.

The form works a treat. I should have thought of that solution but plead
sleep deprivation in my defence.

You were quite correct about the status bar message. The standard
"running query" overwrites my text anyway, but at least I know how to
create the text now :)

Thanks again for your kind assitance.

*** Sent via Developersdex http://www.developersdex.com ***
Aug 13 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dica | last post by:
i've got a client that wants to be able to review records about IIS generated emails. in his own words, he wants the "ability to track and report message status (i.e. how many messages were sent...
4
by: Tingo | last post by:
Hi all, Is it possible to create a message queue with a specific ID? I want to do this because I'm trying to write a piece of software which restores communicating processes (which communicate...
6
by: deepak | last post by:
I have to create message queue at remote machin. My code works properly when i use console application in c#. But it throws exception whenever i try it on web application in c#. My code is ...
5
by: Ikkezelf | last post by:
Hi, I was wondering if it's possible to write a message in the windows message queue by means of c. Already searched a lot through this newsgroup and others. I noticed that it is possible...
3
by: kvadro | last post by:
Hi. I am new in this website. How to create message box, with buttons, and icons? And of course, with text?
4
by: Mark | last post by:
Hey folks, I'm looking at making the following query more efficient potentially using the ranking functions and I'd like some advice from the gurus. The purpose of the following is to have a...
3
by: bharathreddy | last post by:
This article will explain you how to find the status of the fax operation. (Using FAXCOM.dll). Author: Bharath Reddy VasiReddy Reference to the FAXCOM.DLL Reference to import FAXCOM...
0
by: aadsaca | last post by:
hi there, I just want to know if it is possible to create Message Queue on other Computer? if yes, how to do it? tnx,
0
by: patrick khattar | last post by:
I have created a tool with links to some web pages , also configured the tool to open the web page in a form using the Micro soft web browser function What am looking for now how to create a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.