Access: Close a Form that is not the Active form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,694
Can you close one form from another? I know you can close the form you're on by using DoCmd.Close , "". How do I close another form. I need to make sure its not open when I run code.

Thanks
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,199
Office Version
365
Platform
Windows
Try:
Code:
[COLOR=#000000][FONT=&quot]DoCmd.Close acForm, "[/FONT][/COLOR][COLOR=#ff0000][FONT=&quot][B]FormName[/B][/FONT][/COLOR][COLOR=#000000][FONT=&quot]"[/FONT][/COLOR]
and put the actual name of your form in the part in red.
 

Watch MrExcel Video

Forum statistics

Threads
1,090,384
Messages
5,414,133
Members
403,515
Latest member
see_mido

This Week's Hot Topics

Top