Hiding A Field

J

Jim

I'm trying to have a field trigger another field's presence. I have a
field that holds a Y or N. I need for when it show N to not show the
field below it and otherwise to show all the fields.

A screenshot of the undesired producct can be obtained from me if you
have questions.
 
J

Jim

I'm trying to have a field trigger another field's presence. I have a
field that holds a Y or N. I need for when it show N to not show the
field below it and otherwise to show all the fields.

A screenshot of the undesired producct can be obtained from me if you
have questions.

I forgot to mention the coding I have done ...

Private Sub HideBox()
'set focus on the InAContainer field aka if it is in a container
Me.InAContainer.SetFocus
'then test for results and make field invisible if it says no
If Me.InAContainer.Text = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
End Sub

Private Sub Form_Load()
Call HideBox
End Sub

This is in Access 2000 too. I'm not all caught up on my office
software.
 
F

fredg

I forgot to mention the coding I have done ...

Private Sub HideBox()
'set focus on the InAContainer field aka if it is in a container
Me.InAContainer.SetFocus
'then test for results and make field invisible if it says no
If Me.InAContainer.Text = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
End Sub

Private Sub Form_Load()
Call HideBox
End Sub

This is in Access 2000 too. I'm not all caught up on my office
software.

Code the Form's Current event.

Me![EqContainerStoredIn].Visible = Me![InAContainer] = "Y"

Place the same code in the [InAContainer] control's AfterUpdate event.
 
J

Jim

I forgot to mention the coding I have done ...
Private Sub HideBox()
'set focus on the InAContainer field aka if it is in a container
Me.InAContainer.SetFocus
'then test for results and make field invisible if it says no
If Me.InAContainer.Text = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
End Sub
Private Sub Form_Load()
Call HideBox
End Sub
This is in Access 2000 too. I'm not all caught up on my office
software.

Code the Form's Current event.

Me![EqContainerStoredIn].Visible = Me![InAContainer] = "Y"

Place the same code in the [InAContainer] control's AfterUpdate event.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Well ... it doesn't want to evaluate that code. At least that what's
the error code says.
 
F

fredg

I'm trying to have a field trigger another field's presence. I have a
field that holds a Y or N. I need for when it show N to not show the
field below it and otherwise to show all the fields.
A screenshot of the undesired producct can be obtained from me if you
have questions.
I forgot to mention the coding I have done ...
Private Sub HideBox()
'set focus on the InAContainer field aka if it is in a container
Me.InAContainer.SetFocus
'then test for results and make field invisible if it says no
If Me.InAContainer.Text = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
End Sub
Private Sub Form_Load()
Call HideBox
End Sub
This is in Access 2000 too. I'm not all caught up on my office
software.

Code the Form's Current event.

Me![EqContainerStoredIn].Visible = Me![InAContainer] = "Y"

Place the same code in the [InAContainer] control's AfterUpdate event.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Well ... it doesn't want to evaluate that code. At least that what's
the error code says.

Well ....
Me![EqContainerStoredIn].Visible can be either True or False.
Me![InAContainer] = "Y" can be either True or False.

So, [EqContainerStoredIn].Visible will be True or False depending upon
whether the statement [InAContainer] = "Y" is True or False.

If Access cannot evaluate that, then you have something else going on
that is not evident in your message.

You're welcome to go back to your other If .. Then expression if that
helps you, as long as you place it in the Form's Current event and in
the [InAContainer] AfterUpdate event.
Also, it's not the control's Text property you need to check, it's the
Value property. Since Value is the default property you do not need to
state it.

If Me.InAContainer = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
 
J

Jim

On 17 Feb 2007 12:20:50 -0800, Jim wrote:
I'm trying to have a field trigger another field's presence. I have a
field that holds a Y or N. I need for when it show N to not show the
field below it and otherwise to show all the fields.
A screenshot of the undesired producct can be obtained from me if you
have questions.
I forgot to mention the coding I have done ...
Private Sub HideBox()
'set focus on the InAContainer field aka if it is in a container
Me.InAContainer.SetFocus
'then test for results and make field invisible if it says no
If Me.InAContainer.Text = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If
End Sub
Private Sub Form_Load()
Call HideBox
End Sub
This is in Access 2000 too. I'm not all caught up on my office
software.
Code the Form's Current event.
Me![EqContainerStoredIn].Visible = Me![InAContainer] = "Y"
Place the same code in the [InAContainer] control's AfterUpdate event.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -
- Show quoted text -
Well ... it doesn't want to evaluate that code. At least that what's
the error code says.

Well ....
Me![EqContainerStoredIn].Visible can be either True or False.
Me![InAContainer] = "Y" can be either True or False.

So, [EqContainerStoredIn].Visible will be True or False depending upon
whether the statement [InAContainer] = "Y" is True or False.

If Access cannot evaluate that, then you have something else going on
that is not evident in your message.

You're welcome to go back to your other If .. Then expression if that
helps you, as long as you place it in the Form's Current event and in
the [InAContainer] AfterUpdate event.
Also, it's not the control's Text property you need to check, it's the
Value property. Since Value is the default property you do not need to
state it.

If Me.InAContainer = "N" Then
Me.EqContainerStoredIn.Visible = False
Else
Me.EqContainerStoredIn.Visible = True
End If

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Ok I plugged in the code you gave me and it gave me an error message.

It goes as follows:
The expression On Current you entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.

* The expression may result in the name of a macro, the name of a user-
definition, or [Event Procedure].
* There may have been an error evalulating the function, event, or
macro.

I also have buttons (done by wizard) for navigation and other
operations.
 
Top