Custom List Box Columns in Microsoft Access. Dynamically Display Fields Based on User Selection.
HTML-код
- Опубликовано: 14 окт 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:
RUclips: / @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.
The way you are explaining to us is so much interested... Thank you for your classes 🙏
Thanks and welcome
Superb performance of using sql and controls properties... Thank you and congratulations.
Welcome. Glad you enjoyed.
Really , Unique idea , Unique illustrated lesson , thanks a lot , much respect from Egypt
Glad you liked it!
Great idea, thanks so much.
You are so welcome!
Richard, you are a beast. Love the tricks and shortcuts as always. You rock. Thank you.
BEAST MODE ACTIVE! :)
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.
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.
Just made this the topic of tonight's video. Posting it now. Enjoy! :)
@@599CD :))) Thanks!
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.
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?🤔😜
Excellent.
Many thanks!
awesome
please make video on advance vba examples
I've got 37 levels of Developer classes: 599cd.com/Developer
If one of the columns was a currency field, is there a way to format it in the list box?
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?
That would work as well. I don't foresee any problems.
Nice👍👍
Thanks
is it possible in reports same as it ?
Great
Thanks