?
Solved

"DoCmd.RunCommand acCmdRefresh" documentation.

Posted on 2004-03-31
10
Medium Priority
?
3,246 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

752 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