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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Open to check if Form/Report Open

Status
Not open for further replies.
Jan 20, 2005
180
US

Im looking for a way to check to see if a Form and or Reports are open at the time I am opening one of 3 reports/form.

I have 2 forms, 1 filter control, and on data souce/editing form.

The 3 reports check the form to filter on. as does the data source form.

I need to filter control form to check to see if any of the reports or the form is open for 1 filter setting, and a different one if none are open.

Similarly if any of the reports or the data source form is open I need to use the filter that is currently applied to them. There is a strict order that will be followed to check the forms as multiple filtering could be applied to the seperate forms.

So, they base quest, is there a way to check to see if a report or form is open at the time of opening a report or form?
 
This might help:

Private Sub Report_Open(Cancel As Integer)

Dim frm As Form

If (CurrentProject.AllForms("frmMyForm").IsLoaded) Then
Set frm = Forms("frmMyForm")

Me.RecordSource = frm.RecordSource
End If

End Sub
 
If (CurrentProject.Allforms("AformName").IsLoaded) then Msgbox "form is open"

if (CurrentProject.AllReports("AReportName").IsLoaded) then Msgbox "report is open
 
Yes, the CurrentProject.AllForms is what I was needed, thank you...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top