Ambiguous name detected - help how fix?

C

Chet

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
 
R

ryguy7272

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---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top