PC Review


Reply
Thread Tools Rate Thread

Allowedits vs unbound controls

 
 
dymondjack
Guest
Posts: n/a
 
      25th Jan 2009
TIA

I'm in process of setting up some security features for forms in my db.
I've got a public function that handles the opening of forms and sets
particular properties/formats based on the current user.

The three most important properties that I am setting is the forms
AllowEdits, AllowAdditions and AllowDeletions. This (until now) has worked
out great.

I've got an unbound control at the top of my form (hctlGo) that allows a
user to type an ID of some sort (part number, document id etc) to jump to
that particular record, but the problem I've come up with is that if
AllowEdits is set to False, the user cannot type the ID into hctlGo.

Is there a way to allow text entry on this control in particular, while not
effect the more global AllowEdits?

I suppose I could always disregard the AllowEdits and set each control to
disabled if required, but that takes my simple solution and turns it into a
coding nightmare to maintain the format of the controls (I'm not a particular
fan of having all controls 'greyed' when disabled).

If this was only for one form, it wouldn't be too much of an issue, but it
was my intention to set this as a default for all of my 'standard' forms.

Any thoughts? Thanks again

--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      25th Jan 2009
As you found setting a form's AllowEdits to No affects unbound controls as
well.

Set the Locked property of the controls instead. Your code would need to
look all controls, or unlock those applicable to the current user.

For an example of code that loops through all controls on a form to set the
Locked property of each (handling subforms recursively), see:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html

(The example does not set the Locked property per user.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dymondjack" <dymondjack at hot mail dot com> wrote in message
news:9C2B08DB-D313-4018-9791-(E-Mail Removed)...
>
> I'm in process of setting up some security features for forms in my db.
> I've got a public function that handles the opening of forms and sets
> particular properties/formats based on the current user.
>
> The three most important properties that I am setting is the forms
> AllowEdits, AllowAdditions and AllowDeletions. This (until now) has
> worked
> out great.
>
> I've got an unbound control at the top of my form (hctlGo) that allows a
> user to type an ID of some sort (part number, document id etc) to jump to
> that particular record, but the problem I've come up with is that if
> AllowEdits is set to False, the user cannot type the ID into hctlGo.
>
> Is there a way to allow text entry on this control in particular, while
> not
> effect the more global AllowEdits?
>
> I suppose I could always disregard the AllowEdits and set each control to
> disabled if required, but that takes my simple solution and turns it into
> a
> coding nightmare to maintain the format of the controls (I'm not a
> particular
> fan of having all controls 'greyed' when disabled).
>
> If this was only for one form, it wouldn't be too much of an issue, but it
> was my intention to set this as a default for all of my 'standard' forms.


 
Reply With Quote
 
dymondjack
Guest
Posts: n/a
 
      25th Jan 2009
Allen Browne is THE MAN.

Thanks so much, this was exactly what I was hoping to avoid having to write
myself (I'm not the best with working with controls like this and wasn't
looking forward to the the task).

Many many thanks... you just saved me hours upon hours.
--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery


"Allen Browne" wrote:

> As you found setting a form's AllowEdits to No affects unbound controls as
> well.
>
> Set the Locked property of the controls instead. Your code would need to
> look all controls, or unlock those applicable to the current user.
>
> For an example of code that loops through all controls on a form to set the
> Locked property of each (handling subforms recursively), see:
> Locking bound controls on a form and subforms
> at:
> http://allenbrowne.com/ser-56.html
>
> (The example does not set the Locked property per user.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "dymondjack" <dymondjack at hot mail dot com> wrote in message
> news:9C2B08DB-D313-4018-9791-(E-Mail Removed)...
> >
> > I'm in process of setting up some security features for forms in my db.
> > I've got a public function that handles the opening of forms and sets
> > particular properties/formats based on the current user.
> >
> > The three most important properties that I am setting is the forms
> > AllowEdits, AllowAdditions and AllowDeletions. This (until now) has
> > worked
> > out great.
> >
> > I've got an unbound control at the top of my form (hctlGo) that allows a
> > user to type an ID of some sort (part number, document id etc) to jump to
> > that particular record, but the problem I've come up with is that if
> > AllowEdits is set to False, the user cannot type the ID into hctlGo.
> >
> > Is there a way to allow text entry on this control in particular, while
> > not
> > effect the more global AllowEdits?
> >
> > I suppose I could always disregard the AllowEdits and set each control to
> > disabled if required, but that takes my simple solution and turns it into
> > a
> > coding nightmare to maintain the format of the controls (I'm not a
> > particular
> > fan of having all controls 'greyed' when disabled).
> >
> > If this was only for one form, it wouldn't be too much of an issue, but it
> > was my intention to set this as a default for all of my 'standard' forms.

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unbound Controls Calvin Microsoft Access Reports 3 13th Dec 2007 02:03 AM
Unbound controls =?Utf-8?B?Q2hhcmxvdHRl?= Microsoft Access Reports 3 20th Sep 2006 07:45 PM
Unbound controls and AllowEdits = False =?Utf-8?B?QnJpYW4=?= Microsoft Access VBA Modules 3 7th Mar 2005 08:58 PM
unbound controls Microsoft Access 2 26th Jan 2005 10:21 PM
AllowEdits and unbound fields James Martin Microsoft Access Forms 1 16th Nov 2004 01:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.