Access: Close a Form that is not the Active form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,690
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,156
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,089,880
Messages
5,410,935
Members
403,335
Latest member
ddaveryos

This Week's Hot Topics

Top