Hello,
I have a code like this (MS Access 2010):
Me.Name
Where "Name" is an Access Field.
This code works in my PC but not in other PC.
Can anyone tell me why this code sometimes works but sometimes doesn't?
Thanks,
phi.21st
Hello,
I have a code like this (MS Access 2010):
Me.Name
Where "Name" is an Access Field.
This code works in my PC but not in other PC.
Can anyone tell me why this code sometimes works but sometimes doesn't?
Thanks,
phi.21st
Last edited by phi.21st; 08-21-2011 at 11:54 PM. Reason: Just want to add "Thanks" in the bottom of my post
Why doesn't it work - error message, wrong results, nothing happens?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
It gives Compile Error: Method or Data member not found.
Strange.. I changed the code to: Me!Name and it works !!
I found this on Google:
http://www.pcreview.co.uk/forums/com...-t1156996.html,
and i think the problem is related to Service Pack.
I hope this problem wont occur anymore by coding it with Me!Name
Anyway thanks,
phi.21st
I suspected this might be the issue. I always make sure controls have a meaningful name that is different from the bound field, like txtCustomerID. In VBA code I use the bang to qualify field name, dot for controls. The bang also applies when referring to fields of a VBA coded recordset.
Is 'Name' actually the name of a field or is this just a generic alias you used for the post? Should not use reserved words as names, if you do must in enclose in []. Same goes for names with spaces, special characters, punctuation (underscore is an exception).
Last edited by June7; 08-22-2011 at 02:06 PM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Me.Name SHOULD return the name of the form, not a field or control. But that is one of the reasons why you should NOT use NAME as the name of a field or object. NAME is an Access Reserved Word and one of the worst to use as everything (or almost everything) in Access has a .Name property.