Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Showing or hiding some columns in a query?

Discussion in 'Information Technology' started by danijela.simunovic@gmail.com, Nov 6, 2005.

  1. danijela.simunovic@gmail.com

    Guest

    I would like to make 4 checkboxes on a form which would represent 4
    query columns. if the checkbox is checked then the column would be
    visible and if the checkbox isn't checked then the column would be
    hidden. Could this be done through VB or is there some other way of
    doing this?
    Thanks!

    Danijela
     
  2. Loading...


  3. Arvin Meyer [MVP]

    Arvin Meyer [MVP]
    Expand Collapse
    Guest

    It can be done through VBA something like:

    If Me.chkBoxName = True Then
    Me.ControlName.Width = 1440
    Else
    Me.ControlName.Width = 0
    End If

    Do it for each checkbox. This should be done in both the checkbox's
    AfterUpdate event and that event needs to be called or the procedure
    duplicated in the form's Current event. The 1440 represents the number of
    twips in 1 inch, change that to 557 for the number of twips in a centimeter.
    If there are more checkboxes, you might want to loop through them instead of
    writing individual If ... Then statements.
    --
    Arvin Meyer, MCP, MVP
    Microsoft Access
    Free Access downloads
    http://www.datastrat.com
    http://www.mvps.org/access

    <danijela.simunovic@gmail.com> wrote in message
    news:1131207291.873225.118180@g14g2000cwa.googlegroups.com...
    > I would like to make 4 checkboxes on a form which would represent 4
    > query columns. if the checkbox is checked then the column would be
    > visible and if the checkbox isn't checked then the column would be
    > hidden. Could this be done through VB or is there some other way of
    > doing this?
    > Thanks!
    >
    > Danijela
    >
     

Share This Page