runtime error 2450 / cannot find the form....

I

inchong

When i try to open a form i get this error.

steps:
1. main menu - select a customer form
2. Documents button in the customer form - click to see a document
3. View additional button in Document form
4. select any document and click preview button in Document search
form
5. Document-Additional form opens


In database tab window,
i get this error when i try to open Document-Additional form
Error2450 cannot find the form Document search form.....
but, i don't get this error after opening Document search form first
and open Document-Additional form


is there anything i can do here?
VB code for Document-Additional form
Form_Open(Cancel As Integer)
Dim CurrentDB As String, ssql As String, MyFilter As String


CurrentDB = [Forms]![Document Search Form]![Lease/Docs/DB Name
subform].[Form]![DatabaseName]


Please advise me. thanks.
 
S

storrboy

When i try to open a form i get this error.

steps:
1. main menu - select a customer form
2. Documents button in the customer form - click to see a document
3. View additional button in Document form
4. select any document and click preview button in Document search
form
5. Document-Additional form opens

In database tab window,
i get this error when i try to open Document-Additional form
Error2450 cannot find the form Document search form.....
but, i don't get this error after opening Document search form first
and open Document-Additional form

is there anything i can do here?
VB code for Document-Additional form
Form_Open(Cancel As Integer)
Dim CurrentDB As String, ssql As String, MyFilter As String

CurrentDB = [Forms]![Document Search Form]![Lease/Docs/DB Name
subform].[Form]![DatabaseName]

Please advise me. thanks.


This code expects the [Document Search Form] to be open when this
event fires. If it's not then the error you see will occur. You can
add an error trap to open the form if it's not already. Otherwise
revise your 'steps' to open the Searchform first.

'Example:
Form_Open(Cancel As Integer)
Dim CurrentDB As String, ssql As String, MyFilter As String

On Error Resume Next
CurrentDB = [Forms]![Document Search Form]![Lease/Docs/DB Name _
subform].[Form]![DatabaseName]
If Err = 2450 Then
DoCmd.OpenForm "Document Search Form"
Me.SetFocus
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top