473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Programatically Close any form that hasn't got focus

Thank you in advance for any and all assistance. It is greatly appreciated.

I would like to know if there's a way to programatically close any open form
that doesn't have focus?

Michael
Nov 13 '05 #1
2 2280
"Lumpierbritches" <lu*************@aol.com> wrote in message
news:20***************************@mb-m17.aol.com...
Thank you in advance for any and all assistance. It is greatly appreciated.

I would like to know if there's a way to programatically close any open form
that doesn't have focus?


Function CloseOtherForms()

Dim i As Integer
i = Forms.Count - 1

Do Until i = -1
If Forms(i).Name <> Screen.ActiveForm.Name Then DoCmd.Close acForm,
Forms(i).Name
i = i - 1
Loop

End Function
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Dim frm As Access.Form
For Each frm In Application.Forms
If Not frm Is Application.Screen.ActiveForm Then
Application.DoCmd.Close Access.acForm, frm.Name
End If
Next frm

That only does forms in the forms collection -- but
people with object forms won't need this help anyway :~)

(david)

"Lumpierbritches" <lu*************@aol.com> wrote in message
news:20***************************@mb-m17.aol.com...
Thank you in advance for any and all assistance. It is greatly appreciated.
I would like to know if there's a way to programatically close any open form that doesn't have focus?

Michael

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
2
by: Martin Nadoll | last post by:
Hello, i want to close a popup-window with the onBlur eventHandler. function closeIt() { setTimeout('window.close()',2000); } <body onBlur="closeIt()"> html </body>
3
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the...
3
by: Tom Donohue | last post by:
Hello All: I've got, what appears to be a simple problem, but am having a brain cramp on determining the best way to implement. Here is the requirement (I am using ASP.net v1.1) User enters...
7
by: Drew Berkemeyer | last post by:
Hello, We have an application that we have written using ASP.NET. On one of our pages we open a popup window using javascript. The popup window has a save and a cancel button. Both of them are...
0
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the...
1
by: Jake Barnes | last post by:
I've a button that onclick calls a function that calls the following code. The last 3 lines are for IE, which didn't want to close till I put in the funny line with opener. ...
4
by: Deano | last post by:
I have a little search routine going whereby the user types in some text and clicks a button on the main form. I then see if that text exists in a record on the subform. I get a match, grab the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.