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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,216
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,477
Messages
5,414,775
Members
403,544
Latest member
rabdorawsh

This Week's Hot Topics

Top