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!

Is Load Function

Status
Not open for further replies.

Lavenderchan

Technical User
Jul 21, 2008
132
US
Hi I have a question,

I have a unbound form that I'm using to set for my paramter search for a report but the code isn't working right It has something to do with the isload funtion. If I try to use a fix from another question answered it doesn't work.
here is the code
Private Sub Report_Open(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
bInReportOpenEvent = True

' Open Open Items Dialog
DoCmd.OpenForm "Open Items Dialog", , , , , acDialog

' Cancel Report if User Clicked the Cancel Button
If IsLoaded("Open Items Dialog") = False Then Cancel = True

' Set public variable to false to indicate that the
' Open event is completed
bInReportOpenEvent = False
End Sub
I have it set up so that you can not open the form from the form menu but have to open the report to get it to work. But VBA is reading an error on the Is Load again.
Any help would help me with my confusion.
Thanks,
Keri
 

How about...
Code:
 If [COLOR=red]Not[/color] IsLoaded("Open Items Dialog") [s]= False[/s] Then Cancel = True

Randy
 
Which error message ?
Which line of code highlighted when in debug mode ?
Where and how is defined the IsLoaded function ?
How a form open as modal may still be loaded ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi that part of the code is working now I'm having problems with
' Open Open Items Dialog
DoCmd.OpenForm "Open Items Dialog", , , , , acDialog
It gives me an run time error of 2501 Open From Action was Cancelled.
The other part of the code I have on the form I think is not reading the exception. List Below.
Option Compare Database


Private Sub Cancel_Click()
DoCmd.Close
End Sub

Private Sub Form_Open(Cancel As Integer)
If Not bInReportOpenEvent Then
' If we're not called from the report
MsgBox "For use from the Open Items Report only", vbOKOnly
Cancel = True
End If
Form_Open_Exit:
Exit Sub
End Sub

Private Sub OK_Click()
Me.Visible = False
End Sub
Any help with be greatly aprecatied. I thought acces was supposed to read that and skip over it if it was open on the reports menu but its not.
Thanks,
Keri
 
Thanks Randy and PHV I forgot to add my function as a module I did go back and do it and now it's working. Thanks both so much for helping me figure this out.
Keri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top