access: Command button property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sam

    access: Command button property

    Trying to change the visible property on a command button (access97) based
    on a record felid on the form.

    The felid is a check box felid and I am trying to make the button disappear
    with the check box s checked.

    The commend button name is command36 and the check bx feild is named [Multi
    User].

    I have written the following code:
    IIf Me![Multi User] = True, Me!Command36.Vi sible = -1, Me!Command36.Vi sible
    = 0

    The visible functions are working if I put them in the "form load" area of
    the vbcode, but the code will not look at the value of the check box.

    Any ideas?



  • Trevor Best

    #2
    Re: access: Command button property

    On Fri, 05 Sep 2003 06:37:53 GMT in comp.databases. ms-access, "Sam"
    <sam_vk5ksa@hot mail.com> wrote:
    [color=blue]
    >Trying to change the visible property on a command button (access97) based
    >on a record felid on the form.
    >
    >The felid is a check box felid and I am trying to make the button disappear
    >with the check box s checked.
    >
    >The commend button name is command36 and the check bx feild is named [Multi
    >User].
    >
    >I have written the following code:
    >IIf Me![Multi User] = True, Me!Command36.Vi sible = -1, Me!Command36.Vi sible
    >= 0
    >
    >The visible functions are working if I put them in the "form load" area of
    >the vbcode, but the code will not look at the value of the check box.[/color]

    You want the code in the AfterUpdate event of the checkbox, if the
    checkbox is bound then in Form_Current too.

    BTW, your code is a bit long winded for what you want to do and the
    syntax is not correct and it's logic conflicts with your explaination
    in your second paragraph:

    Command36.Visib le = Not [Multi User].Value

    --
    A)bort, R)etry, I)nfluence with large hammer.

    (replace sithlord with trevor for email)

    Comment

    • Sam

      #3
      Re: access: Command button property

      Thanks trevor, the code positions need to be refined but over the result I
      was looking for was acheived.

      Thanks again

      Sam
      "Trevor Best" <bouncer@localh ost> wrote in message
      news:vgdglvopcl 9pp0gv73skkcol6 ne4q2kv0q@4ax.c om...[color=blue]
      > On Fri, 05 Sep 2003 06:37:53 GMT in comp.databases. ms-access, "Sam"
      > <sam_vk5ksa@hot mail.com> wrote:
      >[color=green]
      > >Trying to change the visible property on a command button (access97)[/color][/color]
      based[color=blue][color=green]
      > >on a record felid on the form.
      > >
      > >The felid is a check box felid and I am trying to make the button[/color][/color]
      disappear[color=blue][color=green]
      > >with the check box s checked.
      > >
      > >The commend button name is command36 and the check bx feild is named[/color][/color]
      [Multi[color=blue][color=green]
      > >User].
      > >
      > >I have written the following code:
      > >IIf Me![Multi User] = True, Me!Command36.Vi sible = -1,[/color][/color]
      Me!Command36.Vi sible[color=blue][color=green]
      > >= 0
      > >
      > >The visible functions are working if I put them in the "form load" area[/color][/color]
      of[color=blue][color=green]
      > >the vbcode, but the code will not look at the value of the check box.[/color]
      >
      > You want the code in the AfterUpdate event of the checkbox, if the
      > checkbox is bound then in Form_Current too.
      >
      > BTW, your code is a bit long winded for what you want to do and the
      > syntax is not correct and it's logic conflicts with your explaination
      > in your second paragraph:
      >
      > Command36.Visib le = Not [Multi User].Value
      >
      > --
      > A)bort, R)etry, I)nfluence with large hammer.
      >
      > (replace sithlord with trevor for email)[/color]


      Comment

      Working...