Access: Close a Form that is not the Active form

gheyman

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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,102
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,096,363
Messages
5,449,990
Members
405,581
Latest member
caliope1990

This Week's Hot Topics

Top