|
-
Nov 6th, 2009, 01:29 PM
#1
Thread Starter
Lively Member
[RESOLVED] referring to userform
I created (and hid) a userform at workbook initialize. I now need a control on a worksheet to toggle the visibility of the form, but I have no way to refer to it. How do I do this?
Under workbook initialize:
dim spec as new GraphCriteria
GraphCriteria.hide()
-
Nov 6th, 2009, 02:29 PM
#2
Re: referring to userform
"Workbook_Initialize"? The only Initialize event is in a UserFOrm.
You should be able to reference the UserForm by the UserForm name and that all. No varaible needed.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 6th, 2009, 04:42 PM
#3
Re: referring to userform
Show the code that you are using to create the userform....
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Nov 6th, 2009, 04:57 PM
#4
Re: referring to userform
A UserForm is a UserForm, dont matter as its acessible the same.
I think maybe hes asking for what event to code the button click of a button on a sheet.
Code:
'IF ITS AN ACTIVEX BUTTON
'BEHIND SHEET1
Option Explicit
Private Sub CommandButton1_Click()
GraphCriteria.Hide
End Sub
Code:
'IF ITS A FORMS BUTTON ASSIGN THE MACRO TO THE BUTTON
'IN A STANDARD MODULE
Option Explicit
Public Sub Button1_Click()
GraphCriteria.Hide
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 6th, 2009, 04:58 PM
#5
Thread Starter
Lively Member
Re: referring to userform
Sorry--i'm behind on this thread (so many questions pop up moving to vba that books don't answer). I ditched the declaration in the workbook activation and initialized the form with GraphCriteria.Hide() (it worked). So I now refer to the userform as GraphCriteria. Thanks for your help!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|