Control Tabs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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 said:
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 said:
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
 
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 said:
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 said:
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 said:
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
 
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 said:
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 said:
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 said:
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

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
 
Hi Roger

You mean the line that says:
rctMask.Visible False
???

That's because you left out the "=" sign. What I said was:
rctMask.Visible = False

BTW, make sure that the name of the rectangle control is "rctMask".
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roger Bell said:
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 said:
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 said:
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


:

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

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
 
Just wanted to express my gratitude for your excellent help in this matter.
I finally succeeded in no small part thanks to you


Graham Mandeno said:
Hi Roger

You mean the line that says:
rctMask.Visible False
???

That's because you left out the "=" sign. What I said was:
rctMask.Visible = False

BTW, make sure that the name of the rectangle control is "rctMask".
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roger Bell said:
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 said:
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

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


:

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

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
 
You're welcome, Roger. Glad to know you got it all working :-)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roger Bell said:
Just wanted to express my gratitude for your excellent help in this
matter.
I finally succeeded in no small part thanks to you


Graham Mandeno said:
Hi Roger

You mean the line that says:
rctMask.Visible False
???

That's because you left out the "=" sign. What I said was:
rctMask.Visible = False

BTW, make sure that the name of the rectangle control is "rctMask".
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roger Bell said:
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

:

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

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


:

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

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
 
Back
Top