Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-31-2018, 12:37 PM
Cosmo Cosmo is offline Show userForm from variable Windows Vista Show userForm from variable Office 2007
Competent Performer
Show userForm from variable
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Ok, apparently I'm even rustier in VBA than I had originally thought. I thought I had everything, but I'm having a problem that I believe I've run into before, but don't remember how to solve.

I'm passing the userForm from one function into a class, and instead of passing the UserForm itself, apparently the object I'm receiving as a parameter is the UserForm.Controls object.
Code:
Function test()
   Dim frm As UserForm
   Set frm = New UserForm1


   AddAsObject (frm)

   AddAsUserForm (frm)
End Function

Function AddAsObject(ByRef frm As Object)
   ' This works because the variable received is a 'Controls' object
End Function

Function AddAsUserForm(ByRef frm As UserForm)
   ' This DOESN'T work because the variable received is NOT a 'UserForm' object
End Function
So, how do I pass the UserForm as a parameter to another function?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Show userForm from variable Assigning a string variable to a userform label caption Larry_1 Excel Programming 3 12-18-2017 06:59 AM
Show userForm from variable Show Userform when Content Control CheckBox ticked derajlance Word VBA 1 05-13-2016 01:55 PM
Using Userform.Show in Excel 2013 BillCPA Excel Programming 0 05-04-2015 09:52 AM
Command button to show userform suddenly stopped working jpb103 Word VBA 0 05-22-2014 06:05 AM
Show userForm from variable Show userform without losing document focus? Or other method to get a graphic to pop? AlexR Word VBA 7 03-31-2013 12:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft