Microsoft Access中 - 获取记录ID,当按钮被点击 [英] Microsoft Access - get record id when button is clicked

查看:223
本文介绍了Microsoft Access中 - 获取记录ID,当按钮被点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的访问创建一个表单。

我想知道怎么我得到当我点击一个按钮,当前记录的ID。 我想Me.CurrentRecord在VB按钮code。但这个工作不能正常工作。 任何人都可以帮忙吗?

 私人小组save_record_Enter()

Me.CurrentRecord

结束小组
 

解决方案

您可以通过名字引用域基础记录和表单控件中的MS Access,例如:

  Me.ID
 MSGBOX Me.ID
 Me.txtID
 

I am using access to create a form.

i was wondering how to i get the current record id when i click a button. I tried "Me.CurrentRecord" in the vb button code. but this done not work. Can anyone help ?

Private Sub save_record_Enter()

Me.CurrentRecord

End Sub

解决方案

You can refer to fields in the underlying recordset and form controls in MS Access by name, for example:

 Me.ID
 MsgBox Me.ID
 Me.txtID

这篇关于Microsoft Access中 - 获取记录ID,当按钮被点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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