PC Review


Reply
Thread Tools Rate Thread

Read-Only Limit

 
 
A Moloney
Guest
Posts: n/a
 
      6th Sep 2004
Hi
I have a text box on my form that displays the selected
date from a calender. Is there any way that if the
displayed date is within (+/-) 7 days of todays date that
a password prompt is displayed, one permission is full
access and the other would be read-only?

If this is not possible can i just automatically open the
required record in read-only for everyone?

Any help/alternatives appreciated.
 
Reply With Quote
 
 
 
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      6th Sep 2004
You could use the Current event to run code that locks all controls for that
record if the date value in the textbox is within your desired range. You
also could use this event to ask for a password as you suggest.

--

Ken Snell
<MS ACCESS MVP>

"A Moloney" <(E-Mail Removed)> wrote in message
news:06ae01c49417$beed06e0$(E-Mail Removed)...
> Hi
> I have a text box on my form that displays the selected
> date from a calender. Is there any way that if the
> displayed date is within (+/-) 7 days of todays date that
> a password prompt is displayed, one permission is full
> access and the other would be read-only?
>
> If this is not possible can i just automatically open the
> required record in read-only for everyone?
>
> Any help/alternatives appreciated.



 
Reply With Quote
 
A Moloney
Guest
Posts: n/a
 
      7th Sep 2004
Cheers Ken. Any suggestion on coding to get me started?
(sorry-new to access)
>-----Original Message-----
>You could use the Current event to run code that locks

all controls for that
>record if the date value in the textbox is within your

desired range. You
>also could use this event to ask for a password as you

suggest.
>
>--
>
> Ken Snell
><MS ACCESS MVP>
>
>"A Moloney" <(E-Mail Removed)> wrote

in message
>news:06ae01c49417$beed06e0$(E-Mail Removed)...
>> Hi
>> I have a text box on my form that displays the selected
>> date from a calender. Is there any way that if the
>> displayed date is within (+/-) 7 days of todays date

that
>> a password prompt is displayed, one permission is full
>> access and the other would be read-only?
>>
>> If this is not possible can i just automatically open

the
>> required record in read-only for everyone?
>>
>> Any help/alternatives appreciated.

>
>
>.
>

 
Reply With Quote
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      7th Sep 2004
Code would be something like this:

Private Sub Form_Current()
Dim blnLockControl As Boolean, blnPass As Boolean
Dim strPass As String
blnLockControl = (Abs(DateDiff("d", Me.txtDate.Value, Date())) <=7)
If blnLockControl = True Then
strPass = InputBox("Enter password:")
blnPass = (strPass <> "Password")
Me.NameOfAControl.Locked = (blnLockControl Or blnPass)
Me.NameOfAnotherControl.Locked = (blnLockControl Or blnPass)
' etc.
End If
End Sub

--

Ken Snell
<MS ACCESS MVP>


"A Moloney" <(E-Mail Removed)> wrote in message
news:743801c494d3$395c3110$(E-Mail Removed)...
> Cheers Ken. Any suggestion on coding to get me started?
> (sorry-new to access)
> >-----Original Message-----
> >You could use the Current event to run code that locks

> all controls for that
> >record if the date value in the textbox is within your

> desired range. You
> >also could use this event to ask for a password as you

> suggest.
> >
> >--
> >
> > Ken Snell
> ><MS ACCESS MVP>
> >
> >"A Moloney" <(E-Mail Removed)> wrote

> in message
> >news:06ae01c49417$beed06e0$(E-Mail Removed)...
> >> Hi
> >> I have a text box on my form that displays the selected
> >> date from a calender. Is there any way that if the
> >> displayed date is within (+/-) 7 days of todays date

> that
> >> a password prompt is displayed, one permission is full
> >> access and the other would be read-only?
> >>
> >> If this is not possible can i just automatically open

> the
> >> required record in read-only for everyone?
> >>
> >> Any help/alternatives appreciated.

> >
> >
> >.
> >



 
Reply With Quote
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      7th Sep 2004
Note that this code is not considered as a "secure" way to test a password.
Better to store the password in a table and then use DLookup function to
retrieve the password for comparison. Even more secure is to use built-in
security that ACCESS contains.. but this may be overkill for what you want
to do here.
--

Ken Snell
<MS ACCESS MVP>



"Ken Snell [MVP]" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> Code would be something like this:
>
> Private Sub Form_Current()
> Dim blnLockControl As Boolean, blnPass As Boolean
> Dim strPass As String
> blnLockControl = (Abs(DateDiff("d", Me.txtDate.Value, Date())) <=7)
> If blnLockControl = True Then
> strPass = InputBox("Enter password:")
> blnPass = (strPass <> "Password")
> Me.NameOfAControl.Locked = (blnLockControl Or blnPass)
> Me.NameOfAnotherControl.Locked = (blnLockControl Or blnPass)
> ' etc.
> End If
> End Sub
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
>
> "A Moloney" <(E-Mail Removed)> wrote in message
> news:743801c494d3$395c3110$(E-Mail Removed)...
> > Cheers Ken. Any suggestion on coding to get me started?
> > (sorry-new to access)
> > >-----Original Message-----
> > >You could use the Current event to run code that locks

> > all controls for that
> > >record if the date value in the textbox is within your

> > desired range. You
> > >also could use this event to ask for a password as you

> > suggest.
> > >
> > >--
> > >
> > > Ken Snell
> > ><MS ACCESS MVP>
> > >
> > >"A Moloney" <(E-Mail Removed)> wrote

> > in message
> > >news:06ae01c49417$beed06e0$(E-Mail Removed)...
> > >> Hi
> > >> I have a text box on my form that displays the selected
> > >> date from a calender. Is there any way that if the
> > >> displayed date is within (+/-) 7 days of todays date

> > that
> > >> a password prompt is displayed, one permission is full
> > >> access and the other would be read-only?
> > >>
> > >> If this is not possible can i just automatically open

> > the
> > >> required record in read-only for everyone?
> > >>
> > >> Any help/alternatives appreciated.
> > >
> > >
> > >.
> > >

>
>



 
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
Limit future queries to read-only. David G. Microsoft Access 8 15th Oct 2009 10:03 PM
Limit Read Receipt JD Microsoft Outlook Discussion 2 22nd May 2009 04:52 AM
Limit to number of opened Read Onlys Wendy Microsoft Excel Misc 0 11th Sep 2008 04:35 AM
In an Access db trying to limit some users to read others write =?Utf-8?B?RFAgU0VSVklDRVM=?= Microsoft Access Security 0 21st Jan 2006 12:02 AM
Is this possible? If database already in use, limit all new users to read-only access. Ben Smith Microsoft Access Security 5 12th Sep 2003 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 PM.