How do I lock fields in access so the user is only able to add to table? I want the user to only have access to adding to the table to maintain data integrity.
Since you are using Access 2010 (or later) you can use event-driven Data Macros to restrict what the users can do. To prevent them from deleting records you can use the following Before Delete macro:
If you also want to prevent them from editing existing records you can use the following Before Change macro:
For more information see
Create a data macro
Related
I have three identical tables, one on MySQL, one linked to this one on Access by ODBC, and a native in the same Access database.
When I update the table on MySQL, the linked table on Access updates, and vice versa. But I would like to know if it is possible that the linked table updates the native table (and vice versa)?
Access table
MySQL table
It really depends on how the local Access table is being updated. If it is ALWAYS updated say by a few forms, then you could add a after update even to those few forms, and put in code to update the MySQL table.
Another approch (again you only/always update the local tables) is to add a table trigger to the local table. In this table code event, you can actually have it call some VBA code, and that VBA code could then update/insert to the linked MySQL table. Once again, then the two tables will automatic remain in sync.
The other possible would be to add a time + date stamp column to the tables (both on MySQL side, and on the Access side). You could then write some VBA code to sync up the tables. Such code is not too hard, but in a multi-user setting, this can become quite a challenge, since while you are syncing the data, other users might also update the MySQL tables and thus your sync routines might well miss some tables. Database sync software and this subject can fill a few books the size of medical texts, and is a VERY complex subject.
However, why not just always use linked tables to MySQL, and be done with any requirements to sync data? Access makes a great client to SQL server or MySQL. If you eliminate the local tables, then you eliminate the need to sync your data.
I am attempting to "sync" data from a read-only ODBC MySQL server to Access 2016. I need to move the data into Access so that I can more easily manipulate and create better customized reports.
I have linked the data tables between Access and MySQL, however I cannot get the data in these tables to automatically refresh. I must go into Access and hit "Refresh All".
What I'm looking to do is update all of my open tables in Access once nightly so that each morning the data used to build these reports is new. Currently if I leave these tables all evening, when I get in the next morning I must hit "Refresh-All" for Access to go retrieve the most recent data.
Any ideas?
The data in linked tables is automatically refreshed by access when you attempt to read them. You can do that by displaying a datasheet view of the database, or by a form where the linked table is the data source. Beware, we have had problems which tables with lots of records being the source for drop down lists, having the database locked.
Access only does this properly (and at speed) if either the underlying table has a unique clustered index, or after having linked the tables you create an index in access.
If you want to create a copy that you can manipulate (such as write to) and the underlying tables are read only, then you will have to create matching unlinked tables and execute some form of copy sql and appropriate points in your application.
I have 2 table, one is local named 'Client' and other is a linked table to MySQL DB in my web-server named 'ClientSql'.
When I insert data into the table Client, I want it to be insert into clientSql too. I try it with data macro (after insert), but it shows me an error saying
It's not possible in linked tables.
I have tried to create an append query successfully, and it works, but it just works if I execute it manually. My question is:
Is it possible to call it from a data macro? if is possible, can you show me how? If not, can you point me to a solution?
I'm not sure why you should be able to do it manually, but not via a macro. According to this link
http://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-linked-tables.html
you should be able to do it either way.
Another thought is to eliminate the local access client table and have the access program update the mySql table directly. However, if another program is accessing the client table at the same time, this could become tricky due to multi-user and locking situations.
I have made up Tracker form in Access 2013 in which end user update their daily routine tasks. I want to keep the table as read-only so that no one can make any unauthorized changes in the existing data.
Is there any way to do that in Access?
One solution would be to
move the reference table into a separate database file,
make that file read-only (e.g., by using Windows permissions on the file), and
use a Linked Table in the main database to access the reference table.
Use a query in place of the table, and change its Recordset Type property to Snapshot.
If you want to avoid users opening the table itself, move the table to another database and change the Source property of the table to the path of the other database. In SQL it gives something slike:
SELECT * FROM myTable IN 'f:\test\hidden.mdb'
AFAIK you cannot make a table read only, but you can do a number of things to lock down the database so that the user only has access to forms that are read only.
In Options deselect:
Use Access Special Keys
Display Navigation Pane
Allow Full menus
Allow Default Shortcut Menus
In the form, set the following properties to No:
Allow Additions
Allow Deletions
Allow edits
I have created a data model in Access Database.
Tables that are composite parts of the model are loaded with data. Some of the data needs to be loaded manually.
Now I would like to link couple of tables together and give the user the option to insert the missing data in the tables. (I am linking the tables together so that the user doesn't have to work with raw keys, but with the "actual" information that he knows.)
I+ve never worked with Access DB before and therefore I would like to ask you to please instruct and help me on how to accomplish my goal?
The access form wizards are pretty well put together. You can easily setup a form that will allow them to insert data into the table(s).