Home Database Mysql Tutorial access解决组合框无法满足大量数据的问题

access解决组合框无法满足大量数据的问题

Jun 07, 2016 pm 03:16 PM
access data satisfy combination solve question

问题 : Access里面有 组合 框,可以很快地从多行记录中选择所需要的 数据 。但是如果记录超过1000-2000呢?选择就非常不方便了。我该怎么办? 回答: 其实很多 数据 都可以分类(分层)来选择,而且我们可以预先筛选 数据 。 以下这个示例就是用重复打开同

问题

Access里面有组合框,可以很快地从多行记录中选择所需要的数据。但是如果记录超过1000-2000呢?选择就非常不方便了。我该怎么办?

回答:

其实很多数据都可以分类(分层)来选择,而且我们可以预先筛选数据

以下这个示例就是用重复打开同一个窗体类来完成多层次数据的选择。

当然,还包括预先筛选数据功能。

好了,现在开始:

1、建立一个窗体(testForm),里面有一个文本框(text0),一个按钮(Command2)。

2、建立一个窗体(selectForm),里面有一个列表框(list0)。

3、在testForm中的文本框的“更新后”事件中写入以下代码以打开品名选择窗体(selectForm),并对其中的列表框(list0)的行来源(RowSource)进行赋值。

Private Sub Text0_AfterUpdate()

DoCmd.OpenForm "selectform"

'这行代码就实现了BTYPE表的模糊检索,使用的是 WHERE 子句中的 LIKE 关键字进行通配

Forms("selectform").List0.RowSource = "SELECT btype.soncount, btype.UserCode, btype.FullName, btype.typeId FROM btype WHERE btype.fullname like '*" & Text0.Value & "*' "

End Sub

4、在testForm中的命令按钮的“单击”事件中写入以下代码以打开品名选择窗体,按分类检索

5、然后再在testForm中输入以下代码以完成多次打开窗体本身并显示子类中数据的功能。

为了能够使代码重复利用,写了两个通用过程

Option Compare Database

Dim f

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

'先设定窗体的“键预览”属性为“是”

'本过程将加快你的输入速度

'如果按 ESCAPE 键,就关闭窗体

If KeyCode = vbKeyEscape Then

closeAllSelectForm "SelectForm"

End If

End Sub

Private Sub List0_DblClick(Cancel As Integer)

checkYouSelect

End Sub

Private Sub List0_KeyPress(KeyAscii As Integer)

'本过程实现全键盘操作

If KeyAscii = 13 Then

checkYouSelect

End If

End Sub

Sub closeAllSelectForm(strFormName As String)

'通用过程1

'本过程用来关闭所有的指定名称的窗体

For Each objForm In Forms

If objForm.Name = strFormName Then

DoCmd.Close acForm, objForm.Name

End If

Next objForm

End Sub

Sub checkYouSelect()

'通用过程2

'检测你的选择

'如果发现 suncount 列为 0(表示没有下一层了)

'就可以把你选定的产品名称放到文本框中了

On Error Resume Next

Set f = New Form_SelectForm

Dim objForm As Form

If List0.Column(0) = 0 Then

Forms("testform").Text0.Value = List0.Column(2)

closeAllSelectForm "SelectForm"

Else

f.Visible = True

f.List0.RowSource = "SELECT btype.soncount, btype.UserCode, btype.FullName, btype.typeId FROM btype WHERE parid='" & List0.Value & "'"

End If

End Sub
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications May 07, 2024 pm 04:20 PM

1. Open settings in Windows 11. You can use Win+I shortcut or any other method. 2. Go to the Apps section and click Apps & Features. 3. Find the application you want to prevent from running in the background. Click the three-dot button and select Advanced Options. 4. Find the [Background Application Permissions] section and select the desired value. By default, Windows 11 sets power optimization mode. It allows Windows to manage how applications work in the background. For example, once you enable battery saver mode to preserve battery, the system will automatically close all apps. 5. Select [Never] to prevent the application from running in the background. Please note that if you notice that the program is not sending you notifications, failing to update data, etc., you can

The vitality of super intelligence awakens! But with the arrival of self-updating AI, mothers no longer have to worry about data bottlenecks The vitality of super intelligence awakens! But with the arrival of self-updating AI, mothers no longer have to worry about data bottlenecks Apr 29, 2024 pm 06:55 PM

I cry to death. The world is madly building big models. The data on the Internet is not enough. It is not enough at all. The training model looks like "The Hunger Games", and AI researchers around the world are worrying about how to feed these data voracious eaters. This problem is particularly prominent in multi-modal tasks. At a time when nothing could be done, a start-up team from the Department of Renmin University of China used its own new model to become the first in China to make "model-generated data feed itself" a reality. Moreover, it is a two-pronged approach on the understanding side and the generation side. Both sides can generate high-quality, multi-modal new data and provide data feedback to the model itself. What is a model? Awaker 1.0, a large multi-modal model that just appeared on the Zhongguancun Forum. Who is the team? Sophon engine. Founded by Gao Yizhao, a doctoral student at Renmin University’s Hillhouse School of Artificial Intelligence.

Slow Cellular Data Internet Speeds on iPhone: Fixes Slow Cellular Data Internet Speeds on iPhone: Fixes May 03, 2024 pm 09:01 PM

Facing lag, slow mobile data connection on iPhone? Typically, the strength of cellular internet on your phone depends on several factors such as region, cellular network type, roaming type, etc. There are some things you can do to get a faster, more reliable cellular Internet connection. Fix 1 – Force Restart iPhone Sometimes, force restarting your device just resets a lot of things, including the cellular connection. Step 1 – Just press the volume up key once and release. Next, press the Volume Down key and release it again. Step 2 – The next part of the process is to hold the button on the right side. Let the iPhone finish restarting. Enable cellular data and check network speed. Check again Fix 2 – Change data mode While 5G offers better network speeds, it works better when the signal is weaker

The U.S. Air Force showcases its first AI fighter jet with high profile! The minister personally conducted the test drive without interfering during the whole process, and 100,000 lines of code were tested for 21 times. The U.S. Air Force showcases its first AI fighter jet with high profile! The minister personally conducted the test drive without interfering during the whole process, and 100,000 lines of code were tested for 21 times. May 07, 2024 pm 05:00 PM

Recently, the military circle has been overwhelmed by the news: US military fighter jets can now complete fully automatic air combat using AI. Yes, just recently, the US military’s AI fighter jet was made public for the first time and the mystery was unveiled. The full name of this fighter is the Variable Stability Simulator Test Aircraft (VISTA). It was personally flown by the Secretary of the US Air Force to simulate a one-on-one air battle. On May 2, U.S. Air Force Secretary Frank Kendall took off in an X-62AVISTA at Edwards Air Force Base. Note that during the one-hour flight, all flight actions were completed autonomously by AI! Kendall said - "For the past few decades, we have been thinking about the unlimited potential of autonomous air-to-air combat, but it has always seemed out of reach." However now,

How to convert deepseek pdf How to convert deepseek pdf Feb 19, 2025 pm 05:24 PM

DeepSeek cannot convert files directly to PDF. Depending on the file type, you can use different methods: Common documents (Word, Excel, PowerPoint): Use Microsoft Office, LibreOffice and other software to export as PDF. Image: Save as PDF using image viewer or image processing software. Web pages: Use the browser's "Print into PDF" function or the dedicated web page to PDF tool. Uncommon formats: Find the right converter and convert it to PDF. It is crucial to choose the right tools and develop a plan based on the actual situation.

Tesla robots work in factories, Musk: The degree of freedom of hands will reach 22 this year! Tesla robots work in factories, Musk: The degree of freedom of hands will reach 22 this year! May 06, 2024 pm 04:13 PM

The latest video of Tesla's robot Optimus is released, and it can already work in the factory. At normal speed, it sorts batteries (Tesla's 4680 batteries) like this: The official also released what it looks like at 20x speed - on a small "workstation", picking and picking and picking: This time it is released One of the highlights of the video is that Optimus completes this work in the factory, completely autonomously, without human intervention throughout the process. And from the perspective of Optimus, it can also pick up and place the crooked battery, focusing on automatic error correction: Regarding Optimus's hand, NVIDIA scientist Jim Fan gave a high evaluation: Optimus's hand is the world's five-fingered robot. One of the most dexterous. Its hands are not only tactile

What does field mean in java What does field mean in java Apr 25, 2024 pm 10:18 PM

In Java, a "field" is a data member in a class or interface that is used to store data or state. The properties of field include: type (can be any Java data type), access rights, static (belongs to a class rather than an instance), final (immutable) and transient (not serialized). Field is used to store state information of a class or interface, such as storing object data and maintaining object state.

Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Apr 29, 2024 pm 04:55 PM

FP8 and lower floating point quantification precision are no longer the "patent" of H100! Lao Huang wanted everyone to use INT8/INT4, and the Microsoft DeepSpeed ​​team started running FP6 on A100 without official support from NVIDIA. Test results show that the new method TC-FPx's FP6 quantization on A100 is close to or occasionally faster than INT4, and has higher accuracy than the latter. On top of this, there is also end-to-end large model support, which has been open sourced and integrated into deep learning inference frameworks such as DeepSpeed. This result also has an immediate effect on accelerating large models - under this framework, using a single card to run Llama, the throughput is 2.65 times higher than that of dual cards. one

See all articles