And a very long speech.OK, there is that issue...
I think the below picture clarify all, if it is a property and if it belongs to a form or not, (but not why it doesn't work for the OP).
Attachments
Last edited:
And a very long speech.OK, there is that issue...
Someone mentioned earlier that is part of the Outlook library. Go to your references and remove any that are not strictly Access. Do you still see FormName? I don't see it in my database.
PS - how do you embed the pictures in the text?
Not because I want to be rudeSomeone mentioned earlier that is part of the Outlook library. Go to your references and remove any that are not strictly Access. Do you still see FormName? I don't see it in my database.
DoCmd.Close acForm, Me.FormName
As I posted earlier, when I turned on the show hidden objects, I could see it. Then I went to the immediate window again and got intellisense and could print it. HOWEVER, I went back to the database today and couldn't see it again. So I went and turned on the show hidden objects and could see it AND it worked. When I turn off the show hidden objects, I CANNOT see it and it does not work. It would appear that the show hidden objects must be on to enable the property.
So I went and turned on the show hidden objects and could see it AND it worked. When I turn off the show hidden objects, I CANNOT see it and it does not work. It would appear that the show hidden objects must be on to enable the property.
Colin, not all hidden members are created equal. This particular member does not work when you uncheck the show hidden members option. I am not arguing that some hidden members may work, I'm sure they do and this one used to. Now, in A2016, it only works if the hidden members are shown. To me that means that Microsoft does not want you to use it. I offered a very simple solution. There is no reason to fight with Access over this particular property. Just say uncle and do a global change of Me.FormName to Me.Form.Name. At least the fix is trivial. It is usually much worse when MS decides to deprecate something.
If you say so I believe you but it does NOT work for me. I created a form in a database and added code to it. The code worked as long as the hidden members were displayed but failed when I hid them again.As I've already stated me.formname works for me in both A2010 and A2016
?forms("About").Formname
About
?forms("About").Form.Name
About
?forms("About").Name
About