|
-
May 7th, 2005, 10:52 PM
#1
Thread Starter
Addicted Member
A basic Access question about calling a sub from a button
Hi all!
I have this form on which lies a button that calls another form. Very simply, in the On Open event of this button, I call a sub that will open the form, as follow:
=Open("frmMyForm")
Now the code read something like this:
Function Open(MyForm As string) As Integer
Select Case MyForm
Case "frmMyForm"
DoCmd.OpenForm MyForm
bla bla bla...
Can I pass the form as an object instead of a string? If so what do I have to change in the above?
I tried (and tons of variations):
=Open(frmMyForm)
Function Open(MyForm as object)
with no obvious result.
Anyone's two cents would be appreciated.
p.s. Access 2000
-
May 8th, 2005, 11:24 AM
#2
Re: A basic Access question about calling a sub from a button
Seems like your going about this the long way? If you pass the Form as a Form then there is no need for a select case statement. Just
the call to open the form.
DoCmd.OpenForm "MyForm"
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 
-
May 8th, 2005, 11:41 PM
#3
Thread Starter
Addicted Member
Re: A basic Access question about calling a sub from a button
Hi there Rob,
I was really looking into how to pass diff. arguments type to a sub using the OnEvent property, beside from string type as in =MySub("frmname") ,well if it is possible.
I presume I went asking about this the wrong way. I couldn't care less about opening a form.
lol
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
|