[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Wrtie protect Access Forms

Posted on 2009-04-20
8
Medium Priority
?
349 Views
Last Modified: 2013-11-28
Is there a way to write protect a form outside of putting the database into a folder that has read only properties. I have several controls that are set at run time. The proble is that the controls are filled by cross tab queries built on temporary tables. When the user completes a task the temporary information is deleted and the cross tab table does not have any data and so the column names are now missing in my controls. The user will now get a message box from Access telling them that a control is missing. I would like to keep the user from saving the form with the rowsource. Is there a way to do this in Access or do I need to protect a folder and link all tables to the database.
0
Comment
Question by:Brandon_Campbell
8 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 24184506
Set the form's Record Source to " " using the Unload or Close Event.

ET
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24184519
Hi Brandon,

You can set the Recordset Type to Snapshot


Good Luck!

Gary
0
 
LVL 75
ID: 24186080
On the Form property sheet, set the Allow Edits and Allow Additions properties to No.

mx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Brandon_Campbell
ID: 24189751
Hi,
Thank you for your responses. I need to control the form not the data. I'm not using the security settings but I do have the folder secured where the database is located. I don't know if any of you have experienced this but when everyone can open the database as admin they have the capability of saving the form with whatever is in the rowsource, controlsource, etc. thus causing grief when a form does not have the correct fields due to contrived field names from dynamic queries. Therefore, if anyone know how to admins from saving the form structure that would be great.

Thank you,
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 24191027
Ok, so you are building the structure of the form dynamically ....  I think that's what's changing/saving the form, not the user.  As long as you set the recordsource of the form when it loads to match the fields you dynamically created then you should be ok.  I would use the form's Load and Close Events as shown below.

Private Sub Form_Load()
     Me.RecordSource = "Your dynamic SELECT Statement Here ............;"
End Sub

Private Sub Form_Close()
     Me.RecordSource = ""
End Sub

ET
0
 

Author Comment

by:Brandon_Campbell
ID: 24200432
The recordsource for the form is fine, the problem exists with a listbox control. I have set the unload event to remove the rowsource and change the rowsourcetype to value list. The problem occurs when a user may use ctrl + s  thinking they are saving the data instead they have saved the settings that populated the controls. I know that I could try trapping for ctrl + s but that will take a bit of programming. The other problem would be if the user selected save from the File menu or selected the save icon. In this case I could me custom menu bars and remove the icon all together but all users use the database as admin and therefore can add the icons back and change the menu bar. I have been restricted from using the security features of Access and I am confronted with probably putting a frontside database into a read only folder and linking to tables in a folder that is not write protected. Please advise if you can think of any other possible solution.

Thank you.
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 24200624
Without seeing your project, I'm not exactly sure of all that you are trying to accomplish ... prehaps there's a different concept that should be considered.

However, from your last comments ... sounds like you will have to use a sequence of temp forms or maybe open the formn in Design mode before closing and basically strip it down since it is being created dynamically each time.

ET
0
 

Accepted Solution

by:
Brandon_Campbell earned 0 total points
ID: 24204786
I overlooked the most obvious solution. I apologize for this exercise. The solution is to compile the Access MDB into an Access MDE and thus prevents any users from changing the forms even thought they are connected as admin.

Thank you.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

834 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