CurrentRecord to ID

sapka

Board Regular
Joined
Nov 9, 2009
Messages
110
Let's say there is a table of three columns - ID, Name, Surname - where ID is AutoNumber. ID is not displayed on the Form. How can I find ID number for current/selected record?
I can get current record number by Me.CurrentRecord. But I need to convert it to appropriate ID number. How can I do that in VBA?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Create a command button. Attach code to the command button to display the ID in a MsgBox

Code:
Private Sub Command0_Click()
MsgBox "ID is" & Me.ID.Value
End Sub
 
Upvote 0
Thanks!
It is interesting that even if control ID is not on the Form (I have deleted it), I can still read its value.
 
Upvote 0

Forum statistics

Threads
1,203,026
Messages
6,053,116
Members
444,640
Latest member
Dramonzo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top