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

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ค. 2022
  • 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:
    TH-cam: / @599cd
    or My Site: 599cd.com/THMember
    LEARN MORE:
    599cd.com/CustomListBox
    FOLLOWUP VIDEO:
    599cd.com/EventHandlerFunction
    LINKS:
    Relational Combo: 599cd.com/Relational
    SQL With Access: 599cd.com/SQLwithAccess
    Intro VBA: 599cd.com/VBA
    After Update: 599cd.com/AfterUpdate
    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/Contacts
    Order Entry & Invoicing: 599cd.com/Invoicing
    More Access Templates: 599cd.com/AccessTemplates
    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/TechHelp
    Consulting Help: 599cd.com/DevNet
    Twitter: / learningaccess
    en.wikipedia.org/wiki/Microso...
    products.office.com/en-us/access
    microsoft.com/en-us/microsoft...
    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.

  • @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! :)

  • @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!

  • @tewwonwonii8462
    @tewwonwonii8462 2 ปีที่แล้ว

    Excellent.

    • @599CD
      @599CD  2 ปีที่แล้ว

      Many thanks!

  • @elijahhayes8833
    @elijahhayes8833 10 หลายเดือนก่อน

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

  • @syedabbas201
    @syedabbas201 2 ปีที่แล้ว

    Nice👍👍

    • @599CD
      @599CD  2 ปีที่แล้ว

      Thanks

  • @afrinsir7479
    @afrinsir7479 ปีที่แล้ว

    is it possible in reports same as it ?

  • @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 ปีที่แล้ว

      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.

  • @DingusBatus
    @DingusBatus 17 วันที่ผ่านมา

    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?🤔😜

  • @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

  • @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