justplainsoccer Posted December 4, 2003 Posted December 4, 2003 how would i go about setting a collection equal to another collection. for example, i pass a parameter into a sub, then use a select case to set a general collection equal to a specific collection. make sense? probably not. heres what ive got so far. Private Sub NameCollection(ByVal Which As Short) 'gives the generic object 'collectionOb' a specific value depending on the selected tab Select Case Which Case 1 collectionOb = keyCol Case 2 collectionOb = accCol Case 3 collectionOb = denyCol End Select End Sub (collectionOb is public) Quote
Administrators PlausiblyDamp Posted December 4, 2003 Administrators Posted December 4, 2003 Where are you defining collectionOb? What collection are you using with this routine? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
justplainsoccer Posted December 4, 2003 Author Posted December 4, 2003 i define collectionOb up at the top. Public Class SettingsForm Inherits System.Windows.Forms.Form Dim collectionOb As Object Dim errStr, fileString As String What collection are you using with this routine? What do you mean? Quote
Administrators PlausiblyDamp Posted December 4, 2003 Administrators Posted December 4, 2003 Just reread your post and I think I jet what you mean now. in the snippet Case 1 collectionOb = keyCol Case 2 collectionOb = accCol Case 3 collectionOb = denyCol where are keyCol, accCol and denyCol defined? Also is there a reason you are defining collectionOb as an object rather than a collection? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
justplainsoccer Posted December 4, 2003 Author Posted December 4, 2003 they are declared in the "MainModule". publicly. Public keyCol As New Collection Public accCol As New Collection Public denyCol As New Collection Quote
Administrators PlausiblyDamp Posted December 4, 2003 Administrators Posted December 4, 2003 You code should work then - what results are you getting? Also like I said above why are you defining collectionOb as Object rather than as a collection? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
justplainsoccer Posted December 4, 2003 Author Posted December 4, 2003 hmm. changed it to collection and it worked fine.... of course i thought i had done that before :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.