zelarra821
Registered User.
- Local time
- Today, 21:21
- Joined
- Jan 14, 2019
- Messages
- 860
Application.RunCommand acCmdSave
How do I get this?refresh the view
Try using Application.RefreshDatabaseWindow :How do I get this?
Private Sub CmdCreateTable_Click()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = Application.CurrentDb
' Create a table with two text fields.
dbs.Execute "CREATE TABLE ThisTable " _
& "(FirstName CHAR, LastName CHAR);"
dbs.Close
'Application.RunCommand acCmdSave
Application.RefreshDatabaseWindow
End Sub
You can keep data in the FE that is common to all users.Again, I say, we don't keep data in the FE. Why? because the FE is completely replaced every time you release an update. We especially do not create new objects in the FE. At least keep the log in the BE.
PS, I do keep a log in the FE but it is MY programming log. I update it when I update the FE. This is not user data.
As I mentioned the client list can for example contain the expiry date of a specific client's subscription. After the client pays his subscription this date is changed and the client downloads the new FE.No you can't unless the data is static which of course a client list isn't.
If you think data in the FE is OK, you must be sharing the FE rather than giving each user his own personal copy. That is another big mistake. Only the BE is shared. When you update the FE, you post the updated version in the master folder on the server. The next time the use clicks on his shortcut, the replacement is copied to his local directory and opened.
As I mentioned the client list can for example contain the expiry date of a specific client's subscription. After the client pays his subscription this date is changed and the client downloads the new FE.
And yes you can keep data that is common to all users in the FE. As an example, let's say that all clients use graphic pictures. You have several options:
1) Keep pictures in an external folder on the hard disk
2) Keep it in the BE
3) Keep it in the FE
The FE has its advantages. The user cannot inadvertently delete the external folder and if the pictures are in the FE it is easier to delete, add. update the contents. In our case we have found it extremely helpful. Other people may not find it helpful.
I might put configuration tables in the FE along with static lookup tables. In Northwind, for example:The external folder can be different than the one used for the FE repository or the BE shared file. THAT folder doesn't have to have DELETE privileges for users. Only the BE folder needs full-on MODIFY privileges. As to "the user cannot inadvertently delete"... if you have users who don't honor company-imposed rules on keeping their mitts away from infrastructure, invest in some barbed-wire bullwhips. Inadvertent deletion can only occur when a user is exceeding his/her authority OR when the code has a bad flaw in it. In the first case, find a way to publicly punish that person. In the second case, whose fault is that?
Keeping multiple-user data in a shared FE file that is downloaded to each user's PC might seem reasonable for performance issues, but if ANY FIELD in that FE's user-oriented table gets changed in the BE, you now need to find a way to detect the change and then to reconcile the shared table vs. the master table. You just bought yourself a ton of overhead. Not only that, but TECHNICALLY that FE-side table now violates normalization even if the BE-side table does not. The question related to normalization is this: You now have two fields holding the same data. What other field do you consult to determine whether to refresh from the BE or use the copy in the FE? Which field is definitive? If it is time-sensitive, which copy contains the deciding date? And why do you continue to use the other copy when you know it ISN'T definitive?
I once did something similar to this, but NOT with user data. We had a lot of lookup tables, SOME of which might have records added to them during a business day, but it was a VERY rare event. I put copies of the lookup data in the FE along with a date marker to show when that lookup table was last refreshed. If you were about to run procedures that would use the lookup, the code would compare the dates for the FE and BE sources and would, if needed, refresh the sources before continuing.
This was NEVER anything but lookup/translation data, which 99% of the time was static. When the app started, the lookup tables in the FE got refreshed and usually stayed that way. It was needed because of horrific speed differences in FE vs. BE. Then we finally got the speed issues resolved by being allocated a VM to act as a back-end that could be LOCALLY shared vs. multi-state LAN sharing (and the BE wasn't local.) But I never backed out those dynamic lookup tables once the local BE server was set up because by then I had bigger maintenance issues to resolve. I CAN tell you that without what amounted to a 5000:1 speed difference between FE and BE, I would never have done it.
This SystemSettings table illustrates why you can't do so, however, for all tables.
"UserA" does not update his copy of the FE. He may use the Static data common to all users and the Temporary tables that can be helpful to creating Forms and Reports.So when UserA updates some data in his copy of the FE, how does that get pushed to every other user and their personal copies of the FE?
Remember, in a properly structured application, each user has his own personal copy of the FE which is replaced each time the app opens or whenever the app opens and a version change is identified. The FE is NEVER shared the way the BE is shared.
The data in the FE is basically the same for all users. As I mentioned not all users have the latest FE, but this does not affect their operation. If all clients get the latest FE , they will have the same FE. There is no risk.Just trying to clarify. The common data in the FE is not ever updated because that would make the FE's give different results to different users. Risky but your choice.