Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple VB problem

Status
Not open for further replies.

evild

Technical User
Nov 25, 2002
71
0
0
GB
I have all my forms set up the way i want and i am now working on navigation issues. i have it sorted for the most part but i need some help...

what i am tryin to do is:

IF (form called MASTER is open) THEN
DoCmd.Close acForm, "bas_srch"
Else
DoCmd.OpenForm "homepage"
DoCmd.Close acForm, "bas_srch"
END IF

i just need to know what vb code is to check that a form of a specified name is open or not. im sure this muct be simple but i dont know vb.

additionally, can anyone recommed any online resources with a complete reference to access vb?
 
This function can help you:

Public Function IsFormOpen(FormName As String) As Boolean
Dim frm As Form

For Each frm In Application.Forms
If frm.name = FormName Then
IsFormOpen = True
Exit Function
End If
Next frm

IsFormOpen = False
End Function

I use MSDN when standard Mircosoft Visual Basic help is not sufficient.
 
thanks for the help.

i found a web page with a listing of a number of vb sites so heres the url for anyone interested...


note: when clicking the links you will be asked to register...so dont click them...just use the name and open a new browser yourself with the address.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top