By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

I can set a subform control's locked attribute but not visible. Why is this so?

P: n/a
Good Afternoon Everyone,

Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.

Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then

DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True

DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True

DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True

DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True

Else
End If

End Sub

Could someone please explain where I am going wrong?
Thank you
Regards
Kevin

Feb 12 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On Feb 11, 9:45 pm, kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,

Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.

Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then

DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True

DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True

DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True

DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True

Else
End If

End Sub

Could someone please explain where I am going wrong?
Thank you
Regards
Kevin

Most likely because you can't make a control invisible while it has
focus.
Ensure that the focus is somewhere else before you try to change it.

Feb 12 '07 #2

P: n/a
On Feb 12, 1:45 pm, kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,

Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.

Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then

DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True

DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True

DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True

DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True

Else
End If

End Sub

Could someone please explain where I am going wrong?
Thank you
Regards
Kevin
My apologies
This code does set the Visibility to False (No in the properties box,
under the format tab). The problem is that I can still see it - It is
not invisible!
Any ideas?

Feb 12 '07 #3

P: n/a
On Feb 11, 9:57 pm, kevin.vaug...@nhw.hume.org.au wrote:
On Feb 12, 1:45 pm, kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,
Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.
Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then
DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True
DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True
DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True
DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True
Else
End If
End Sub
Could someone please explain where I am going wrong?
Thank you
Regards
Kevin

My apologies
This code does set the Visibility to False (No in the properties box,
under the format tab). The problem is that I can still see it - It is
not invisible!
Any ideas?

Sorry, I'm probably just getting tired but I don't understand the form
heirarchy.
Please outline how it's setup, and which one you're trying to make
invisible.

IE. MainForm SubFormControl 2ndSubFormControl ect.

Feb 12 '07 #4

P: n/a
On Feb 12, 2:06 pm, "storrboy" <storr...@sympatico.cawrote:
On Feb 11, 9:57 pm, kevin.vaug...@nhw.hume.org.au wrote:
On Feb 12, 1:45 pm, kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,
Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.
Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then
DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True
DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True
DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True
DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True
Else
End If
End Sub
Could someone please explain where I am going wrong?
Thank you
Regards
Kevin
My apologies
This code does set the Visibility to False (No in the properties box,
under the format tab). The problem is that I can still see it - It is
not invisible!
Any ideas?

Sorry, I'm probably just getting tired but I don't understand the form
heirarchy.
Please outline how it's setup, and which one you're trying to make
invisible.

IE. MainForm SubFormControl 2ndSubFormControl ect.
Main Form(DoctorsHandover) SubForm (DoctorsHandoverSubform) >
Textbox Control (MedicalPlan)
The main Form is called
DoctorsHandover

DoctorsHandoverSubform - (this is a datasheet subform)

The textbox control [MedicalPlan]
is a control within DoctorsHandoverSubform

I'm trying to make the textbox [MedicalPlan] invisible

Feb 12 '07 #5

P: n/a
I don't have a good answer for you; I first thought you had to set the
Subform Control's visibility, but both the following work to toggle
visibility of the OrderDetails Subform in a test database.

Me.sbfOrderDetails.Visible = Not Me.sbfOrderDetails.Visible

or

Me.sbfOrderDetails.Form.Visible = Not Me.sbfOrderDetails.Form.Visible

And, it seemed to make no difference if some of the Fields were Locked. I
put the code behind two Command Buttons and both of them make the entire
Subform Control and Contents invisible.

I am at a loss as to why you are experiencing this.

You might try creating a new form, copying the controls and code (you'll
have to copy them separately, unless you have mztools or a comparable
package/add-in) to that, and seeing if it works then.

Larry Linson
Microsoft Access MVP


<ke***********@nhw.hume.org.auwrote in message
news:11**********************@k78g2000cwa.googlegr oups.com...
Good Afternoon Everyone,

Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.

Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then

DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True

DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True

DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True

DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True

Else
End If

End Sub

Could someone please explain where I am going wrong?
Thank you
Regards
Kevin

Feb 12 '07 #6

P: n/a
ke***********@nhw.hume.org.au wrote:
Good Afternoon Everyone,

Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.

Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then

DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True

DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True

DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True

DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True

Else
End If

End Sub

Could someone please explain where I am going wrong?
Thank you
Regards
Kevin
You might want to look at ColumnHidden property in help.
Feb 12 '07 #7

P: n/a
On Feb 12, 4:23 pm, salad <o...@vinegar.comwrote:
kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,
Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.
Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then
DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True
DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True
DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True
DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True
Else
End If
End Sub
Could someone please explain where I am going wrong?
Thank you
Regards
Kevin

You might want to look at ColumnHidden property in help.

Fantastic, Thanks Salad

This was the issue - the column is now hidden.
My challenge now, is to block the non medical users from unhiding this
column while allowing them to hide and unhide other columns.
Do you know if this is possible?
Regards
Kevin

Feb 12 '07 #8

P: n/a
On Feb 12, 12:55 am, kevin.vaug...@nhw.hume.org.au wrote:
On Feb 12, 4:23 pm, salad <o...@vinegar.comwrote:


kevin.vaug...@nhw.hume.org.au wrote:
Good Afternoon Everyone,
Could someone please explain why I can't set the Subform control
[MedicalPlan] Visible attribute to False as below?
The statement for the locked attributes work but not for the
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
Form Open etc.
Private Sub DoctorsHandoverSheetSubform_Enter()
If Discipline <"Medical" Then
DoctorsHandoverSheetSubform.Form![MedicalPlan].Visible
= False
DoctorsHandoverSheetSubform.Form![MedicalPlan].Locked
= True
DoctorsHandoverSheetSubform.Form!
MedicalProblems.Locked = True
DoctorsHandoverSheetSubform.Form!ActionsTaken.Lock ed =
True
DoctorsHandoverSheetSubform.Form!
MedAbnormalResults.Locked = True
Else
End If
End Sub
Could someone please explain where I am going wrong?
Thank you
Regards
Kevin
You might want to look at ColumnHidden property in help.

Fantastic, Thanks Salad

This was the issue - the column is now hidden.
My challenge now, is to block the non medical users from unhiding this
column while allowing them to hide and unhide other columns.
Do you know if this is possible?
For non-medical users, set record source to a view which excludes all
columns they are never allowed to see.

Feb 12 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.