By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,608 Members | 3,801 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,608 IT Pros & Developers. It's quick & easy.

Application.CurrentObjectName returns no value?

P: n/a
Hello

I completed an application that worked great until I went to STARTUP
and shut off all of the checkboxes. My code uses
"Application.CurrentObjectName" to get the current Form name.
All my forms seem OK, but my problem exists ONLY in my initial form. If
the DataBaseWindow selection in STARTUP is OFF, then the
Application.CurrentObjectName in my initial form returns no value,
which is wrong. When DBW is ON then I get the correct Form name. I
test using a Msgbox in the Form_Open and Form_Load and only get a true
value when the STARTUP DBW is ON. However, when the STARTUP DBW is Off
(my desire), then I can only get a correct value from the
CurrentObjectName, if I call it from a button on the form, the values
returned from the Form_Open & Form_Load is empty.

What Gives?

Jul 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
well, if you want to get the name of the current form object as it opens or
loads, you can get that in the Open or Load event, as

Me.Name

hth
<Ap******@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
Hello

I completed an application that worked great until I went to STARTUP
and shut off all of the checkboxes. My code uses
"Application.CurrentObjectName" to get the current Form name.
All my forms seem OK, but my problem exists ONLY in my initial form. If
the DataBaseWindow selection in STARTUP is OFF, then the
Application.CurrentObjectName in my initial form returns no value,
which is wrong. When DBW is ON then I get the correct Form name. I
test using a Msgbox in the Form_Open and Form_Load and only get a true
value when the STARTUP DBW is ON. However, when the STARTUP DBW is Off
(my desire), then I can only get a correct value from the
CurrentObjectName, if I call it from a button on the form, the values
returned from the Form_Open & Form_Load is empty.

What Gives?

Jul 10 '06 #2

P: n/a
Hi Tina

Thankyou for responding. I am aware of your suggestion, unfortunately
this will not solve my problem readily. My problem actually takes
place in a Module1. This is where a have a Procedure that LogsErrors.
The Application.CurrentObjectName was used here, and would properly
return the correct formname where the error occurred, in the Forms
outside the module that has focus. If I were to use Me.Name, it would
have to occur in each seperate Form, and pass a variable to the
proceedure, requiring me to modify all my ErrorHandling for all
Procedures... HUGE. >WHEN WILL THIS APP BE DONE! I believe,
Application.CurrentObjectName should work. Any place I can find
detailed info on this statement ?

ThanksAgain
Greg

tina wrote:
well, if you want to get the name of the current form object as it opens or
loads, you can get that in the Open or Load event, as

Me.Name

hth
<Ap******@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
Hello

I completed an application that worked great until I went to STARTUP
and shut off all of the checkboxes. My code uses
"Application.CurrentObjectName" to get the current Form name.
All my forms seem OK, but my problem exists ONLY in my initial form. If
the DataBaseWindow selection in STARTUP is OFF, then the
Application.CurrentObjectName in my initial form returns no value,
which is wrong. When DBW is ON then I get the correct Form name. I
test using a Msgbox in the Form_Open and Form_Load and only get a true
value when the STARTUP DBW is ON. However, when the STARTUP DBW is Off
(my desire), then I can only get a correct value from the
CurrentObjectName, if I call it from a button on the form, the values
returned from the Form_Open & Form_Load is empty.

What Gives?
Jul 10 '06 #3

P: n/a
I'M NOT SURE, but this may be my problem:

I'm collecting the name of the active object, but a form does not
become
the active object until after its Open, Load, and even Current events
have
fired.

The ActiveForm object is not established or changed until a form
receives the focus. This is true for both Form View and Design View.
However in Form View, when a form is opened, a sequence of form Focus
events occurs : Open , Load , Resize , Activate , Current.

Ap******@gmail.com wrote:
Hi Tina

Thankyou for responding. I am aware of your suggestion, unfortunately
this will not solve my problem readily. My problem actually takes
place in a Module1. This is where a have a Procedure that LogsErrors.
The Application.CurrentObjectName was used here, and would properly
return the correct formname where the error occurred, in the Forms
outside the module that has focus. If I were to use Me.Name, it would
have to occur in each seperate Form, and pass a variable to the
proceedure, requiring me to modify all my ErrorHandling for all
Procedures... HUGE. >WHEN WILL THIS APP BE DONE! I believe,
Application.CurrentObjectName should work. Any place I can find
detailed info on this statement ?

ThanksAgain
Greg

tina wrote:
well, if you want to get the name of the current form object as it opens or
loads, you can get that in the Open or Load event, as

Me.Name

hth
<Ap******@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
Hello
>
I completed an application that worked great until I went to STARTUP
and shut off all of the checkboxes. My code uses
"Application.CurrentObjectName" to get the current Form name.
All my forms seem OK, but my problem exists ONLY in my initial form. If
the DataBaseWindow selection in STARTUP is OFF, then the
Application.CurrentObjectName in my initial form returns no value,
which is wrong. When DBW is ON then I get the correct Form name. I
test using a Msgbox in the Form_Open and Form_Load and only get a true
value when the STARTUP DBW is ON. However, when the STARTUP DBW is Off
(my desire), then I can only get a correct value from the
CurrentObjectName, if I call it from a button on the form, the values
returned from the Form_Open & Form_Load is empty.
>
What Gives?
>
Jul 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.