Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2007, 12:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default Read Only Form Is not Read only

This is a little odd.
I have a form that I have created my "frmMainMenu" out of. Many buttons exist taking the user into different forms to input information on.
For the users who are not allowed to modify the data, I created a form "frmMainMenu_ro", I used DoCmd.OpenForm.....acFormReadOnly... for all the buttons on that menu, but two of my buttons are opening the form and allowing the user to edit the first record. Then after they scroll off the first record, it acts as read only. The code between these two buttons and all the rest that are working properly is identical (except the form name, of course). I don't want to change the setting directly on the form because then the users who are allowed to enter information will not be able to either.
Even once I create the .mde file, it still reacts the same.
Has anyone seen or heard of this happening? I am clueless on how to fix this.

Thanks!

Regards,
Laura

FYI...My user id has changed. My old id was lbreitenbach

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
__________________
Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old June 11th, 2007, 01:53 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Where are you getting the user information from that you can tell they are not allowed to edit data? I am assuming you are using account types, and you can tell by account type, and not by user name. If that is accessible, then do this on the On Current event of the form:

If UserGroup <> "Editor" Then 'for example
   Me.btn1.Visible = False
   Me.btn2.Visible = False
   Me.txtBox1.Enabled = False
   etc
Else
   Me.btn1.Visible = True
   Me.btn2.Visible = True
   Me.txtBox1.Enabled = True
   etc
End If

You can use various conditions based on your user information. I did this backwards since you will want to to default to a negative condition if information is missing. But you get the idea.

Did that help?



mmcdonal
 
Old June 11th, 2007, 03:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Actually, I'm not pulling user names. I created different Main Menu's based on the two groups. Then changed the start-up form depending on which .mde interface I was creating. Then I control which one they use based on which one I e-mail to the user. Sounds a little generic and dorky, I know...but I haven't used security in any other way yet. I bought that book on Access Security that you suggested in the last topic I had, but I haven't had much time to play around and learn it yet.

Regards,
Laura

FYI...My user id has changed. My old id was lbreitenbach

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old June 12th, 2007, 06:30 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Well, if you have different versions of the front end, then just do this on the forms where you don't want the users doing data entry:

On Current:
 Me.btn1.Visible = False
 Me.btn2.Visible = False
 Me.txtBox1.Enabled = False


Alternatively, you can just disconnect the tables and use local tables so it doesn't matter if they get into the tables and start to mess around. Also, in the this interface, select each table etc, and then right click and select Properties, and check the hidden box. Then if they open the database window they won't be able to see the tables - unless they know how to view them etc.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read child page form value on different domain davenic Javascript How-To 9 December 2nd, 2007 09:38 PM
What to Read Next ralphtrent BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 July 17th, 2004 01:53 AM
Read first!!!Please help me!!!Thank you!!! wood000 Wrox Book Feedback 1 June 24th, 2004 09:22 AM
read-only probs in msaccess db using asp form anupamda Classic ASP Databases 1 February 10th, 2004 12:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.