Problem: Access has a combo box that allows you to quickly select the required data from multiple rows of records. But what if the record exceeds? It is very inconvenient to select. What should I do? A: In fact, a lot of data can be classified (stratified), and we can pre-filter data. The following example is repeated.
Problem: There is a combination box in Access to quickly select the required data from multiple rows of records. But what if the record exceeds? It is very inconvenient to select. What should I do? A: In fact, a lot of data can be classified (stratified), and we can pre-filter data. The following example is repeated.
Problem:
Access hasCombinationBox, you can quickly record from multiple rowsSelectRequiredData. But what if the record exceeds?SelectIt is very inconvenient. What should I do?
Answer:
Actually manyDataCan be classified (layered ).SelectAnd we can pre-filterData.
In the following example, the same form class is repeatedly opened for multiple layers.DataOfSelect.
Of course, pre-screening is also included.DataFunction.
Before reading this article, please refer:
New users: how to design a table structure to facilitate the display of treeview?
Http://access911.net/index.asp? Board = 4 & recordid = 75FABE1E12DC
To learn how to defineDataThe table structure can be easily classified and displayed.
And read:
How to repeat a form twice and display differentData?
Http://access911.net/index.asp? Board = 4 & recordid = 72FAB11E15DC
To understand that a FORM in ACCESS is actually a class
Now start:
1. Create a form (testForm) with a text box (text0) and a button (Command2 ).
2. Create a form (selectForm) with a list box (list0 ).
3. In the "updated" event of the text box in testForm, write the following code to open the product name.SelectForm (selectForm), and assign values to the row source (RowSource) of the list box (list0.
PrivateSubText0_AfterUpdate ()
DoCmd. OpenForm "selectform"
'This line of code implements fuzzy search for the BTYPE table, using the LIKE keyword in the WHERE clause for wildcard
Forms ("selectform"). List0.RowSource = "SELECTbtype. soncount, btype. UserCode, btype. FullName, btype. typeIdFROMbtypeWHEREbtype. fullnamelike '*" & Text0.Value &"*'"
EndSub
4. In the "click" event of the command button in testForm, write the following code to open the product name.SelectForm, search by category
12 next page