|
-
Mar 28th, 2007, 09:37 AM
#1
Thread Starter
Lively Member
[RESOLVED] Cancelling termination event of form in VBA
Hi,
Anyone know is there a way of cancelling the termination of a form in VBA? I know theres a cancel event with the unload method of a form in VB6 but not how the same can be done in VBA and I can't find an unload event in VBA.
Thanks.
-
Mar 28th, 2007, 03:15 PM
#2
Lively Member
Re: Cancelling termination event of form in VBA
I was looking for the same answer. I have this macro running a userform which suppose to stay on but when run the second time it terminates the form.
-
Mar 28th, 2007, 03:44 PM
#3
Re: Cancelling termination event of form in VBA
Just Two questions...
1) Are you working in VBA Excel?
2) When you say 'Termination' do you mean the 'Terminate Event' i.e when the user clicks on the Close button?
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
-
Mar 29th, 2007, 03:45 AM
#4
Thread Starter
Lively Member
Re: Cancelling termination event of form in VBA
Yes,
when the user clicks the close button. In the termination VBA code, there's no cancel event. There's no form unload event either. How does one stop the the closing of a form in this case?
Thanks.
-
Mar 29th, 2007, 03:57 AM
#5
Thread Starter
Lively Member
Re: Cancelling termination event of form in VBA
Hi,
Actually found a solution to this. Was looking at the wrong event. It's not the termination event I should be looking at, it's the QueryClose event. Please look at the following web-site, which provides a solution to this tricky problem.
http://vb-helper.com/howto_vba_noclose_userform.html
Thanks for all involved for their help.
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
|