Re: Control Tabs
- From: Roger Bell <RogerBell@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 17:19:01 -0800
Thanks again Graham. Have added the code as follows to the OnChange event
procedure of the TabCtl. However when I run the command I am getting an
error referring to the line rctMask.Visible.........
Maybe I have the rectangle incorrect. I used the Rectangle tool and covered
Page 7 and then used fill/back colour to block out the fields for just this
page. Have I done this correctly? as I am not to familiar with Masking
Thanks again for your patience
Private Sub TabCtl0_Change()
rctMask.Visible = True ' Mask page 7
If Me!TabCtl0 = 7 Then
If Not InputBox("Please Enter Password") = "roger" Then
Me!TabCtl0 = 0
MsgBox "Sorry, Incorrect Password"
Else
'show the tab page
rctMask.Visible False
End If
End If
End Sub
"Graham Mandeno" wrote:
Hi Roger.
You just need to make the rectangle visible (mask the page) at the beginning
of your Change procedure and hide it if the authorisation is successful.
Private Sub TabCtl0_Change()
rctMask.Visible = True ' mask page 7
If Me!TabCtl0 = 7 Then
If Not InputBox("Please Enter Password") = "roger" Then
Me!TabCtl0 = 0
MsgBox "Sorry, Incorrect Password"
Else
' show the tab page
rctMask.Visible = False
End If
End If
End Sub
Be sure that you do Format>Bring to Front on the rectangle and Format>Send
to back on all the other controls on the tab page.
Also, you might find it frustrating having the rectangle covering everything
in design view, so set its height and width to zero (or something very
small) in design view and resize it in your Form_Load procedure.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"Roger Bell" <RogerBell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5063FA08-6B72-40EE-980B-F678959ECD1E@xxxxxxxxxxxxxxxx
Thanks for your suggestion Graham. Have used a Masking Rectangular box
over
the page. Could you please tell me the code I would need to write and
where
it should appear.
You help is much appreciated
"Graham Mandeno" wrote:
Hi Roger
You are right. The Change event fires after the new page has been
displayed. It's a pity they didn't think to make it a cancellable event.
I've tried Click and MouseDown also and they are of no use.
Perhaps you could do this by placing a masking rectangular box over the
page
and setting its Visible property to False if the required authentication
is
achieved.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"Roger Bell" <RogerBell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1F1B0DC4-FCC9-430B-B4AC-76EBCBB979CD@xxxxxxxxxxxxxxxx
I have designed a Form with Tabs to move from one section of the form to
another. I have the following OnChange Event procedure that will not
allow
changes to be made without a Password:
Private Sub TabCtl0_Change()
If Me!TabCtl0 = 7 Then
If Not InputBox("Please Enter Password") = "roger" Then
Me!TabCtl0 = 0
MsgBox "Sorry, Incorrect Password"
End If
The problem is that as soon as the user clicks this Tab, the message
box
appears asking for the Password; however, the User can still view the
confidential information on this screen behind the Message Box.
Is there a way to prevent this?
Thanks for any help
- Follow-Ups:
- Re: Control Tabs
- From: Graham Mandeno
- Re: Control Tabs
- References:
- Re: Control Tabs
- From: Graham Mandeno
- Re: Control Tabs
- From: Graham Mandeno
- Re: Control Tabs
- Prev by Date: Re: User log in issues
- Next by Date: Re: Control Tabs
- Previous by thread: Re: Control Tabs
- Next by thread: Re: Control Tabs
- Index(es):
Relevant Pages
|