Solved

"DoCmd.RunCommand acCmdRefresh" documentation.

Posted on 2004-03-31
10
3,079 Views
Last Modified: 2012-06-27
"DoCmd.RunCommand acCmdRefresh".... Where do I find documentation regarding what this does.  I am taking over someone elses program and this command seems to be doing something ugly when working in a multi-user environment.
0
Comment
Question by:Finch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 10726272
Hello Finch,

To the best of my knowledge there is no documentation on the Runcommand options.

They do whatever the corresponding menu option would do.

In this case the data is refreshed for whatever object has focus at the time the command runs.

Pete
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 10726315
This example accepts the name of an open table and refreshes the data.

Sub TableRefresh(strTable As String)
    DoCmd.SelectObject acTable, strTable, False
    DoCmd.RunCommand acCmdRefresh
End Sub

0
 

Author Comment

by:Finch
ID: 10726748
In the example you've provided, what happens if user #2 hits the database with a Command during the time in-between the two DoCmds?  Is the object from  User#2 the object which has focus ???? btw there are multiple users sharing a common MDB database that is located on a server.

Sub TableRefresh(strTable As String)
    DoCmd.SelectObject acTable, strTable, False

?? What happens if User#2 DOES SOMETHING HERE???

    DoCmd.RunCommand acCmdRefresh
End Sub
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 77

Expert Comment

by:peter57r
ID: 10726842
The program is executing on the user's local pc.
User 2 cannot interfere with what is happening on user 1's screen.

If both users are changing the same data then you might get locking issues.

What exactly is the problem you are trying to diagnose?

Pete
0
 

Author Comment

by:Finch
ID: 10726987
There seems to be some level of interaction between user-1 and user-2.  Sometimes it is Lock issues but I've changed the record in question to be 2048 Bytes so there should not be record-locking issues, also I've added "retires" around all .Edit and .Update commands in this module.  What I've done as a test is to put both user-1 and user-2 into loops where both are hitting the database (MDB) and both are using the acCmdRefresh.... the acCmdRefresh on user-2 seems to cause lock-errors or other object-errors on user-1.

Any suggestions on hpw to protect or isolate the various users?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10730094
I can't tell from previous post whether you have split the database into frontend/backend operation, with each user having their own copy of the frontend.
This is always the essential first step in a multi-user set-up.

Pete
0
 

Author Comment

by:Finch
ID: 10731973
Yes, it is split.  Backend is an MDB database on a server, each user has a copy of the frontend which is an MDB program.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10732659
'There seems to be some level of interaction between user-1 and user-2.  Sometimes it is Lock issues but I've changed the record in question to be 2048 Bytes so there should not be record-locking issues'

2048 is the page size for A97.
It's 4096 for A2000+.

When you did this did you fill the fields with text?  Access only uses the space it needs to hold actual data, not the full declared field size.  

But if you are not referring to locking issues what do you mean by 'some level of interaction'?

(These sort of problems drive you mad, don't they!)

Pete


0
 

Author Comment

by:Finch
ID: 10733184
That does shine some light on why packing the record size did not resolve my issue.  I did not know the record size is 4096 and I did not realize that Text fields would not make the record a fixed size..... Thanks

Now the issue is that making the record size 4096 would result in way too much waste.

The issue is that the operators are very fast typists and do not see the little black circle in the datagrid that warns them of a lock... So if I can come up with a way to save the keystrokes or maybe force them to pause from entering data for a short time while the lock is resolved (or even better if I can know when the lock is active) I can make them happy and be a hero for at least an hour.

Any suggestions? Is there a way for me to programmatically know when the "Black-Circle of Lock" is present?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 10735091
As far as I know there is no way to detect a locked record without trying to save it.

Would it be possible to write the input to a temporary local table and periodically append the records to the main file? This would eliminate locks at input time and the transfers would be easy to manage.

Pete
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question