VBA Userform.Show Subscript out of range

Joined
Jan 25, 2011
Messages
3
Reaction score
0
As an old time procedural language programmer, I am struggling with VBA and OOP.

I am writting a VBA App for a local small business. The macro code is in 1 workbook (H2Oasis01) the data is in another (H2ONameDB).

In H2Oasis01, WorkBook_Activate
frmH2OMain.Show
cmdMemberMaint_click
- Open H2ONameDB, Build and sort an alternate index into H2ONameDB based on Last 4 digits of Phone Number (Seems to work, index built into an array defined as a Global.
- (Re)activate H2Oasis01
frmMaintMain.Show
Goes down with Subscript out of range
Other forms in the same project will "show"
frmMaintMain has been renamed, same issue

I understand that the subscript out of range "probably" means that VBA cannot find the Userform, and I understand that logic (semantics are weak, but logic is OK)...I have looked, re-looked, and looked again. I want to think it has something to do with two workbooks open and it cannot find the userform in H2ONameDB (which is correct, it is not there) but that begs the question, Why will other forms in the same project "show" and this one will not? @#*! trees are hiding the forest!
 
Joined
Jan 25, 2011
Messages
3
Reaction score
0
Went a little further, created a new userform (frmDummy), guess what, frmDummy.Show works....h-m-m-m
 
Joined
Jan 25, 2011
Messages
3
Reaction score
0
Stranger and Stranger...it now appears the DeBug(er) isn't working correctly. In the Sub Userform_Activate There was Code to Activate the Macro Worksbook (H2Oasis01) and The Worksheet(SystemVars) within it that contains global variables that need to survive a close/shutdown, I removed that code and ta-ta- it works. So it appears that the real thing VBA could not find was either in'Workbook("H2Oasis01").activate or WorkSheets("SystemVars").Activate
 

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