PC Review


Reply
Thread Tools Rate Thread

Disable and Lock All Feilds wiht a check box

 
 
Biss
Guest
Posts: n/a
 
      26th Apr 2010
Hi I am using MS 2007 and have a form that I would like to lock = yes and
enable = No on all fields..

I would like to do this by checking a check box.. I would also like to have
the lock = no and enable = yes when I uncheck the check box..

Any ideas would be appreciated..

Many thanks in advance.

Bob



 
Reply With Quote
 
 
 
 
Biss
Guest
Posts: n/a
 
      27th Apr 2010
Thanks Maurice,

To tell you the truth I never new allow edits was a option, but it only
makes sense that it would be there

I would put this in the clic even or afterupdate event.

if me.chkenable then
me.allowedits=true
else
me.allowedits=false
end if

or do I have that backwards if I want to have the form read only when the
check box is checked?

Thanks again Maurice..

Bob

Que tenga buena noche.



"Maurice" <(E-Mail Removed)> wrote in message
news:49FC3A16-0062-47A6-8744-(E-Mail Removed)...
> Why would you want to disable all the fields if you lock them? Seems a bit
> double but in this case you could go for the option to allow edits or not.
> So in the click event of the checkbox you could set something like:
>
> if me.chkEnable then
> me.allowedits=true
> me.allowadditions=true
> else
> me.allowedits=false
> me.allowadditions=false
> end if
>
> etc.
>
> or even tighter you could set the property of the form to read only..
> hth
> --
> Maurice Ausum
>
>
> "Biss" wrote:
>
>> Hi I am using MS 2007 and have a form that I would like to lock = yes and
>> enable = No on all fields..
>>
>> I would like to do this by checking a check box.. I would also like to
>> have
>> the lock = no and enable = yes when I uncheck the check box..
>>
>> Any ideas would be appreciated..
>>
>> Many thanks in advance.
>>
>> Bob
>>
>>
>>

 
Reply With Quote
 
Maurice
Guest
Posts: n/a
 
      27th Apr 2010
Biss,

Try this in the click event of the checkbox:

Private Sub Checkbox_Click()
If Me.Checkbox Then
Dim ctl As Control

For Each ctl In Me
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
ctl.Enabled = False
End If
Next
Else
For Each ctl In Me
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
ctl.Enabled = True
End If
Next
End If
End Sub

if you try to use the checkbox in combination with allowedits you'll see
that you can toggle the checkbox once and after that you cannot remove the
check anymore because edits aren't allowed.

the first option will disable the controls where the Else will enable the
controls again.

hth

--
Maurice Ausum


"Biss" wrote:

> Thanks Maurice,
>
> To tell you the truth I never new allow edits was a option, but it only
> makes sense that it would be there
>
> I would put this in the clic even or afterupdate event.
>
> if me.chkenable then
> me.allowedits=true
> else
> me.allowedits=false
> end if
>
> or do I have that backwards if I want to have the form read only when the
> check box is checked?
>
> Thanks again Maurice..
>
> Bob
>
> Que tenga buena noche.
>
>
>
> "Maurice" <(E-Mail Removed)> wrote in message
> news:49FC3A16-0062-47A6-8744-(E-Mail Removed)...
> > Why would you want to disable all the fields if you lock them? Seems a bit
> > double but in this case you could go for the option to allow edits or not.
> > So in the click event of the checkbox you could set something like:
> >
> > if me.chkEnable then
> > me.allowedits=true
> > me.allowadditions=true
> > else
> > me.allowedits=false
> > me.allowadditions=false
> > end if
> >
> > etc.
> >
> > or even tighter you could set the property of the form to read only..
> > hth
> > --
> > Maurice Ausum
> >
> >
> > "Biss" wrote:
> >
> >> Hi I am using MS 2007 and have a form that I would like to lock = yes and
> >> enable = No on all fields..
> >>
> >> I would like to do this by checking a check box.. I would also like to
> >> have
> >> the lock = no and enable = yes when I uncheck the check box..
> >>
> >> Any ideas would be appreciated..
> >>
> >> Many thanks in advance.
> >>
> >> Bob
> >>
> >>
> >>

 
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
RE: Disable and Lock All Feilds wiht a check box Maurice Microsoft Access Forms 0 26th Apr 2010 10:00 PM
Disable or Lock check box after initial check deb Microsoft Access 1 10th Dec 2007 03:55 PM
Disable Password Prompt/Disable User Lock =?Utf-8?B?SnVsY28=?= Windows XP General 2 25th Aug 2006 02:05 AM
trouble wiht query. check last record =?Utf-8?B?U2VlZGU=?= Microsoft Access Queries 9 4th Apr 2006 04:54 AM
Disable lock Ellen S. Windows XP Security 1 28th Apr 2004 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:58 PM.