PC Review


Reply
Thread Tools Rate Thread

Ambiguous name detected - help how fix?

 
 
Chet
Guest
Posts: n/a
 
      15th Jul 2009
I am getting an error when I click the cancel button on my userform
and I know what it means but I don't know for sure how to fix it. The
error message is "Ambigous name detected: RunStatus" I have a user
form and one option is to "cancel" out of the userform. The cancel
button is associated with a commandbutton control and in that
commandbutton I use the following code.

Private Sub CommandButton2_Click()
Unload FWRdataSortSubTtl
RunStatus = False
End Sub

This code then goes back to the main module (I hope it does anyway)
after the userform is unloaded. At this point the code should take me
to the end of the main module with the following code.

'SHOW THE DATA FORM
RunStatus = True
FWRdataSortSubTtl.Show
If Not RunStatus Then GoTo TakeToEnd

I do something like this where I use the RunStatus variable in most
all of my other main modules in personal.xls but I thought those other
instances of RunStatus were unique to those modules and would not
interfere with this instance. Any clues what I might be doing wrong?
Like I said I know what the error means but am not sure how to fix it
since I didn't think I had any duplication of the use of the variable
name in the scope of what I am doing.

Thanks,

Chet
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      15th Jul 2009
Sounds like you have 2 macros with the same name or two variables with the
same name. You can try to eyeball it and find the problem or maybe you
should copy/paste your code to a notepad, delete what you have, and start
over...if the overall code, modules, useforms, etc., is relatively easy to
recreate.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Chet" wrote:

> I am getting an error when I click the cancel button on my userform
> and I know what it means but I don't know for sure how to fix it. The
> error message is "Ambigous name detected: RunStatus" I have a user
> form and one option is to "cancel" out of the userform. The cancel
> button is associated with a commandbutton control and in that
> commandbutton I use the following code.
>
> Private Sub CommandButton2_Click()
> Unload FWRdataSortSubTtl
> RunStatus = False
> End Sub
>
> This code then goes back to the main module (I hope it does anyway)
> after the userform is unloaded. At this point the code should take me
> to the end of the main module with the following code.
>
> 'SHOW THE DATA FORM
> RunStatus = True
> FWRdataSortSubTtl.Show
> If Not RunStatus Then GoTo TakeToEnd
>
> I do something like this where I use the RunStatus variable in most
> all of my other main modules in personal.xls but I thought those other
> instances of RunStatus were unique to those modules and would not
> interfere with this instance. Any clues what I might be doing wrong?
> Like I said I know what the error means but am not sure how to fix it
> since I didn't think I had any duplication of the use of the variable
> name in the scope of what I am doing.
>
> Thanks,
>
> Chet
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ambiguous name detected? Derrick Microsoft Excel Misc 7 8th Jul 2009 07:05 PM
Ambiguous name detected?? =?Utf-8?B?YXdyZXg=?= Microsoft Access VBA Modules 3 27th Oct 2006 03:34 AM
Ambiguous name detected Sue Microsoft Access Forms 1 22nd Jan 2004 06:04 PM
Ambiguous Name Detected Nigel Microsoft Excel Programming 11 26th Oct 2003 09:59 AM
Ambiguous Name Detected Kim Microsoft Outlook Printing 0 27th Aug 2003 09:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:55 AM.