从组合中选择值时,在Access子窗体数据表中突出显示该记录 [英] When select value from combo, highlight that record in Access subform datasheet

查看:341
本文介绍了从组合中选择值时,在Access子窗体数据表中突出显示该记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access窗体,上面有一个组合框和一个子窗体.子窗体处于数据表模式(我想要的方式).我正在尝试做的是做一种搜索功能.从组合框中选择某些内容后,我希望子窗体的数据表滚动到并突出显示匹配的记录.

I have an Access form with a combobox and a subform on it. The subform is in datasheet mode (the way I want it). What I'm trying to do is make a sort of search function. When something is selected from the combobox, I want the subform's datasheet to scroll to and highlight the matching record.

我不想过滤子表单(即删除所有不匹配的记录).

I do not want to filter the subform (i.e. remove all non-matching records).

任何人都可以给我一些有关如何实现这一目标的指导吗?

Can anyone give me some guidance on how to achieve this?

推荐答案

类似以下内容:

Private Sub Combo0_AfterUpdate():
    With Me.Child0.Form.Recordset
        .FindFirst "ID_Field=" & Me.Combo0
    End With
End Sub

这篇关于从组合中选择值时,在Access子窗体数据表中突出显示该记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆