Re: Hiding A Field

Tech-Archive recommends: Fix windows errors by optimizing your registry



On 17 Feb 2007 14:23:15 -0800, Jim wrote:

On Feb 17, 3:49 pm, fredg <fgutk...@xxxxxxxxxxxxxxx> wrote:
On 17 Feb 2007 12:20:50 -0800, Jim wrote:





On Feb 17, 3:15 pm, "Jim" <jim.be...@xxxxxxxxx> 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
.



Relevant Pages

  • Re: I cant get the form to do what I want!
    ... Place the same code in the AfterUpdate event of both and ... Please respond only to this newsgroup. ... I do not reply to personal e-mail ... the sum is not -2, only one or the other, or neither box is checked. ...
    (microsoft.public.access.forms)
  • Re: Combo boxes in a form
    ... Set each combo box RowSource Type proprty to "Value List" ... code the AfterUpdate event of Combo2: ... Please respond only to this newsgroup. ... I do not reply to personal e-mail ...
    (microsoft.public.access.forms)
  • Re: Email field to start with "mailto:"
    ... Code the AfterUpdate event of the control you enter the address in: ... Please respond only to this newsgroup. ... I do not reply to personal e-mail ...
    (microsoft.public.access.forms)
  • Re: set default value after update
    ... Code the AfterUpdate event of the control: ... Please respond only to this newsgroup. ... I do not reply to personal e-mail ...
    (microsoft.public.access.forms)
  • Re: Option group Question
    ... > Put the following code in the AfterUpdate event of your option group: ... > Your Resource For Help With Access, ... Many post regularly in this newsgroup, ...
    (comp.databases.ms-access)