Selasa, 23 Oktober 2012

Re: [MS_AccessPros] Writing code for Command Buttons

 

Samuel,

Two of my sample db's as mentioned below, might also be helpful in providing some working ideas:

(a) Form_SetPermissionLevels
(b) NotesHierarchical

These samples (in access 2000 file format) are available at Rogers Access Library.
Link:
http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45

Sample (a):
------------
It demonstrates setting of permission levels (e.g AllowAdditions, AllowEdits etc) for various forms as applicable to different user groups. On selecting (or entering - if new) the name of desired form, a matrix of virtual records is presented in the subform, displaying settable properties (e.g AllowAdditions, AllowEdits etc) against each group ID. Each GrpID in table T_Grps is represented by one virtual record in this matrix.

As and when any of the properties is set by clicking the check box in pertinent column, the erstwhile virtual record gets converted into an actual record in table T_Permissions. This way, the table is not burdened with redundant records (e.g. groups for which no permission has been set). At the same time, full matrix (of virtual plus actual records) is always available for convenient setting or editing of permissions for the given form, group-wise. During the process of setting permissions, GrpID column of each record gets conditionally highlighted, depending upon the numbers granted as against overall total.

Sample (b):
------------
It demonstrates handling of performance notes in an organization. Persons in administrative position are assigned various levels. For example the top boss has level 1. Managers next in command, each have level 2. Supervisors next in command, each have level 3. General employees do not have any level assigned to them.

Any person in administrative position, wishing to record a note, has to log in using a password. On successful log in, the noter has full read/write access to his own notes for the selected employee. At the same time, all the notes for this employee, as recorded by other noters (only those in the chain of command below the current noter) get displayed, but in read-only state.

The notes table, has a Yes/No field named Sent. When Sent is set to true, the note in question can no longer be edited, even by the person who recorded it originally. More-over, once set to True, it can no longer be re-set to False and no back dated note can be created. For example, if note dated 31-Dec-2006 for a given combination of employee and noter has been marked sent, and we are now in year 2007, any new note with date prior to 31-Dec-2006 can not be created by this noter for the given employee.

Best wishes,
A.D. Tejpal
------------

----- Original Message -----
From: Samuel H Wilson Jr
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, October 24, 2012 03:39
Subject: RE: [MS_AccessPros] Writing code for Command Buttons

Thank you for all your assistance. I will be in touch as I go through the process of learning VBA. I did purchase Mastering VBA for Microsoft Office 2010.

As for my current project I am rethinking the process for command button #3 to be password protected to allow editing. Have to go over that one with my VP and Manager.

Samuel H Wilson Jr., A+, MCP


"For no matter how many promises God has made, they are "Yes" in Christ. And so through him the "Amen" is spoken by us to the glory of God." 2 Corinthians 1:20

"His yes and my amen brings Divine action which changes me and my situation." Rev. P. Johansson 3/25/12

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Tuesday, October 23, 2012 5:37 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Writing code for Command Buttons

Samuel-

Just about any book for Access 2003 and later that covers VBA should do
the trick.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: "Samuel H. Wilson, Jr." <swilson853@verizon.net <mailto:swilson853%40verizon.net> >
Reply-To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Date: Tuesday, October 23, 2012 9:23 PM
To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Subject: Re: [MS_AccessPros] Writing code for Command Buttons

Can you recommend a book that covers VBA programing for access 2010?

Sent from my Samsung Epic™ 4G TouchJohn Viescas <JohnV@msn.com <mailto:JohnV%40msn.com> >
wrote:Samuel-

And how do you know who is a "manager"?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: "Samuel H. Wilson, Jr." <swilson853@verizon.net <mailto:swilson853%40verizon.net> >
Reply-To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Date: Tuesday, October 23, 2012 7:28 PM
To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Subject: Re: [MS_AccessPros] Writing code for Command Buttons

#2 allows the person completing the form to review and edit the form.
#3 allows the completed form to be viewed by all but only edited by
managers.

Sent from my Samsung Epic 4G TouchJohn Viescas <JohnV@msn.com <mailto:JohnV%40msn.com> >
wrote:Samuel-

How does that differ from #2? #2 opens for editing - perhaps after
entering a password, and #3 always opens read-only.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: Samuel H Wilson Jr <swilson853@verizon.net <mailto:swilson853%40verizon.net> >
Reply-To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Date: Monday, October 22, 2012 11:44 PM
To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> >
Subject: RE: [MS_AccessPros] Writing code for Command Buttons

For #3, all can view the forms in read only but only selected
people can edit the forms.

Samuel H Wilson Jr., A+, MCP

From: MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com>
[mailto:MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of
John Viescas
Sent: Monday, October 22, 2012 11:27 AM
To: MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] Writing code for Command Buttons

Samuel-

For #2, you need code in the Current event of the form to look at
your
checkbox field and lock / unlock all controls as appropriate.
That's much
easier to do in VBA than in a macro.

For #3, do you mean only select people can open the form at all -
read
only? Or do those with a password have the ability to edit as
well? You
would need to pop open another form to prompt for the password
and then
proceed only if the password is OK.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: Samuel <swilson853@verizon.net <mailto:swilson853%40verizon.net>
<mailto:swilson853%40verizon.net> >
Reply-To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com>
<mailto:MS_Access_Professionals%40yahoogroups.com> >
Date: Monday, October 22, 2012 12:16 PM
To: <MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com>
<mailto:MS_Access_Professionals%40yahoogroups.com> >
Subject: [MS_AccessPros] Writing code for Command Buttons

I am using MS Access 2010.
I have a database that I created for work that I need to modify
using
command buttons on a form which I call frmOpening. It has three
command
buttons:
1-Create: Used to open a new blank form. This button works fine
with a
macro.
2-Edit/Review: Used to edit forms and review forms. The macro
works for
editing and reviewing. I need to add a procedure to lock the
individual
form when it is completed. I tried to do it with a check box on
in form
design but it locked all forms, even those not edited.
3-View: Used to view completed forms in read only mode, however I
would
like to create a procedure to allow the form to be opened by
select people
via password.

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)
.

__,_._,___

Tidak ada komentar:

Posting Komentar