我使用的访问创建一个表单。
我想知道怎么我得到当我点击一个按钮,当前记录的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