|
-
Feb 24th, 2005, 02:03 PM
#1
Thread Starter
Frenzied Member
Access VBA - CloseCurrentDatabase
I have a little app written in Access.
In function Main which is called by the autoexec macro I do some initialization before loading the main form.
Based on some conditions, a restart is sometimes required.
I call the CloseCurrentDatabase method to close the current database (I can't call quit becuase it doesn't save the changes to any options) and get an Action failed error.
this is a problem because the database window is showing after they close the error window.
Anyone knows why I'm getting this. I have another app and it's working perfectly.
Thanks,
Don't anthropomorphize computers -- they hate it
-
Feb 24th, 2005, 02:07 PM
#2
Re: Access VBA - CloseCurrentDatabase
Could it be because that in this "problem" db your having errors that are causing yuo to re-open your db?
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 
-
Feb 24th, 2005, 02:14 PM
#3
Thread Starter
Frenzied Member
Re: Access VBA - CloseCurrentDatabase
No, I stepped through the code and the only line causing an error is the one calling the CloseCurrentDatabase function.
Don't anthropomorphize computers -- they hate it
-
Feb 24th, 2005, 03:36 PM
#4
Re: Access VBA - CloseCurrentDatabase
Can you tell me more of what your doing that requires you to re-open your db?
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 
-
Feb 24th, 2005, 03:42 PM
#5
Thread Starter
Frenzied Member
Re: Access VBA - CloseCurrentDatabase
I'm not re-opening the db.
I found the problem.
the macro was calling the function this way:
=Main()
When it should have been calling it this way:
Main()
Thanks,
Don't anthropomorphize computers -- they hate it
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
|