Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page