Custom List Box Columns in Microsoft Access. Dynamically Display Fields Based on User Selection.

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • In this Microsoft Access tutorial, I'm going to teach you how to select which fields are displayed in the columns of a list box based on the user selection.
    Annie from Pembroke Pines, Florida (a Platinum Member) asks: is there any way for the user to change the columns that are displayed on a form? Sometimes we want to see the customer's phone number. Other times we want to see their address. I don't want to make a giant form with everything on it, and I don't want to have to make lots of different forms. Can this be done?
    Silver Members and up get access to an Extended Cut of this video. Members will learn how to get rid of the check boxes. We will read the fields directly from the table properties, including which fields to display, the caption, field name, column width, and whether it should display on form load or not.
    MEMBERS VIDEO:
    • Custom List Box Column...
    BECOME A MEMBER:
    UA-cam: / @599cd
    or My Site: 599cd.com/THMe...
    LEARN MORE:
    599cd.com/Cust...
    FOLLOWUP VIDEO:
    599cd.com/Even...
    LINKS:
    Relational Combo: 599cd.com/Rela...
    SQL With Access: 599cd.com/SQLw...
    Intro VBA: 599cd.com/VBA
    After Update: 599cd.com/Afte...
    SUGGESTED COURSE:
    Multi-Select List Boxes: 599cd.com/ACD15
    OTHER COURSES:
    FREE Access Beginner Level 1: 599cd.com/Free1
    $1 Access Level 2: 599cd.com/1Dollar
    FREE TEMPLATE DOWNLOADS:
    TechHelp Free Templates: 599cd.com/THFree
    Blank Template: 599cd.com/Blank
    Contact Management: 599cd.com/Cont...
    Order Entry & Invoicing: 599cd.com/Invo...
    More Access Templates: 599cd.com/Acce...
    ADDITIONAL RESOURCES:
    Donate to my Tip Jar: 599cd.com/TipJar
    Get on my Mailing List: 599cd.com/YTML
    Contact Me: 599cd.com/Contact
    TechHelp: 599cd.com/Tech...
    Consulting Help: 599cd.com/DevNet
    Twitter: / learningaccess
    en.wikipedia.o...
    products.offic...
    microsoft.com/...
    KEYWORDS:
    microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, user defined List Box Columns, Specify Columns, User Editable, Multiple Columns, Populating a MultiColumn ListBox, column widths, multi-select list box, read settings from table, Display only Selected Fields
    QUESTIONS:
    Please feel free to post your questions or comments below. Thanks.

КОМЕНТАРІ • 28

  • @renjithvijayakumar9022
    @renjithvijayakumar9022 2 роки тому

    The way you are explaining to us is so much interested... Thank you for your classes 🙏

    • @599CD
      @599CD  2 роки тому

      Thanks and welcome

  • @josecandidosorianavalon3339
    @josecandidosorianavalon3339 2 роки тому

    Superb performance of using sql and controls properties... Thank you and congratulations.

    • @599CD
      @599CD  2 роки тому

      Welcome. Glad you enjoyed.

  • @adelabdelhamid8272
    @adelabdelhamid8272 2 роки тому

    Really , Unique idea , Unique illustrated lesson , thanks a lot , much respect from Egypt

    • @599CD
      @599CD  2 роки тому

      Glad you liked it!

  • @hassanrozh6579
    @hassanrozh6579 2 роки тому +3

    Great idea, thanks so much.

    • @599CD
      @599CD  2 роки тому +2

      You are so welcome!

  • @peterl2616
    @peterl2616 2 роки тому

    Richard, you are a beast. Love the tricks and shortcuts as always. You rock. Thank you.

    • @599CD
      @599CD  2 роки тому

      BEAST MODE ACTIVE! :)

  • @DingusBatus
    @DingusBatus 2 місяці тому

    Instead of a bunch of IF statements could it be done with Select Case? Select Case Control.Name.
    It wouldn’t really shorten the code any, and I don’t know about performance difference, which would be faster, but it “might” look tidier? Certainly a bit more show off like?🤔😜

  • @achimmarliani2949
    @achimmarliani2949 2 роки тому

    Hi Richard, just a short remark: as it comes to adding OnClick events to all the checkboxes you state that there is no easier way to do this. In fact there IS an other and sometimes easier way (and I assume you also know it). That is to in the event properties list add the line "=RequeryList()" to all the OnClick-events instead of adding multiple event handlers, one for each checkbox. But this requires the RequeryList function to be a public function, and I agree that this might be out of scope of even a intermediate level lesson. But all in all, I love to watch your videos, in each of them I find some gems I did'nt know oder understand correctly until.

    • @599CD
      @599CD  2 роки тому

      You're mostly correct, Achim. That is definitely quicker than making a unique event handler for each checkbox. I say "mostly" correct because RequeryList doesn't need to be a PUBLIC function. It can still be a private function in that form's module. You do need to make it a function though, even though it doesn't have to return a value. But this would make a cool advanced trick to show people. Thanks for the reminder (I haven't used this technique myself in years). I'll put it in an upcoming Fast Tips video. Hmm... maybe tonight's. :) You are also correct that I try not to put TOO MUCH information in a single video. I don't want to blow peoples' brains. LOL.

    • @599CD
      @599CD  2 роки тому

      Just made this the topic of tonight's video. Posting it now. Enjoy! :)

    • @achimmarliani2949
      @achimmarliani2949 2 роки тому

      @@599CD :))) Thanks!

    • @jacksonmacd
      @jacksonmacd 2 роки тому

      Along the same lines, it would be badly simpler to use a store the display width in the Tag property of each checkbox. Then use a constant record source and control each columns width using the value from the Tag property.

  • @tewwonwonii8462
    @tewwonwonii8462 2 роки тому

    Excellent.

    • @599CD
      @599CD  2 роки тому

      Many thanks!

  • @elijahhayes8833
    @elijahhayes8833 Рік тому

    If one of the columns was a currency field, is there a way to format it in the list box?

  • @afrinsir7479
    @afrinsir7479 2 роки тому

    awesome
    please make video on advance vba examples

    • @599CD
      @599CD  2 роки тому

      I've got 37 levels of Developer classes: 599cd.com/Developer

  • @afrinsir7479
    @afrinsir7479 Рік тому

    is it possible in reports same as it ?

  • @syedabbas201
    @syedabbas201 2 роки тому

    Nice👍👍

    • @599CD
      @599CD  2 роки тому

      Thanks

  • @josemariaroman7057
    @josemariaroman7057 2 роки тому

    Is it possible just to modify the ColumnWdth property with a 0 or non 0 value depending on the state of the corresponding checkbox? This way all columns are there, but you don't see all of them, and do not have to modify the RecordSource. Or would there be any unforeseen problem?

    • @599CD
      @599CD  2 роки тому

      That would work as well. I don't foresee any problems.

  • @abdulhamidalhaddadi2255
    @abdulhamidalhaddadi2255 2 роки тому

    Great

    • @599CD
      @599CD  2 роки тому

      Thanks