Solved

"DoCmd.RunCommand acCmdRefresh" documentation.

Posted on 2004-03-31
10
2,885 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
  • 5
  • 4
10 Comments
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
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 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
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
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 77

Expert Comment

by:peter57r
Comment Utility
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
Comment Utility
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
Comment Utility
'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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now