me.name (1 Viewer)

eMel

Registered User.
Local time
Today, 12:36
Joined
Jun 23, 2014
Messages
62
I want to write my form name to a field called ItemName on a table when aform is opened/closed. Can't quite figure out me.name. Help?

SQL = "INSERT INTO EventLog ( Event, EvTime, UserName, ItemName ) SELECT '" & LogEvent & "' AS x1, #" & Now() & "# as x2, fOSUserName(), me.name;"


Why can't I reply to the replies below???
 
Last edited:

KenHigg

Registered User
Local time
Today, 15:36
Joined
Jun 9, 2004
Messages
13,327
me.Form.Name
 

Cronk

Registered User.
Local time
Tomorrow, 05:36
Joined
Jul 4, 2013
Messages
2,772
Use
"Insert into Table1 (Formname) select '" & Me.Name & "'"
if the code is executed in the form being opened.

Alternatively, use Gina's construct, but in the same format above, if from somewhere else.
 

Users who are viewing this thread

Top Bottom