Solved

"DoCmd.RunCommand acCmdRefresh" documentation.

Posted on 2004-03-31
10
3,167 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

726 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