Parameters

S

Simon

Dear Sir/Madam i want ask you for that ..

I have a main form which has a button, when the user clicks the button opens
an other form with the paramaters :

Call Open_Form_1(Me!Fld_1.Name, "tbl_Test", Form_Frm_Test.Name)

the porcedure is ..

Private Sub Open_Form_1(FldName As String, TblName As String, FileN As String)
On Error GoTo Err_Open_Form_1

.....
....
if ....
Forms(FileN).Allowadditions=True
DoCmd.OpenForm FileN, acNormal, , , acFormAdd, acDialog
else
Forms(FileN).Allowadditions=False
DoCmd.OpenForm FileN, acNormal, , , acFormEdit, acDialog
endif
....

end sub

My question is the the commands forms(FileN), appers a message that the
access can't find the form in the FileN parameter.

How can i fix it ?

Thank you in advance for your collaboration

Simon
 
S

Simon

I tried, but nothing

I want to tell you that,

The first command ...Call Open_Form_1(Me!Fld_1.Name, "tbl_Test",
Form_Frm_Test.Name)... is carried out through the code of the form it belongs
to.
The procedure this command calls is in a seperate module.

Private Sub Open_Form_1(FldName As String, TblName As String, FileN As
String)
On Error GoTo Err_Open_Form_1
....
...
if ....
Forms(FileN).Allowadditions=True
DoCmd.OpenForm FileN, acNormal, , , acFormAdd, acDialog
else
Forms(FileN).Allowadditions=False
DoCmd.OpenForm FileN, acNormal, , , acFormEdit, acDialog
endif
...
end sub

The problem is that the form cannot open, and an error message appears "the
access couldn't find the form "Frm_Test".

What can i do for it ?

Thanking you in advance
 
D

Douglas J. Steele

I have to ask the obvious question.

Do you have a form named Frm_Test in your database?
 
S

Simon

Yes
the command with the problem is the "Forms(FileN).Allowadditions=True"

when i call the
 
D

Douglas J. Steele

Is Frm_Test open when that line runs? (it doesn't have to be visible, but it
must be open.)
 

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

Similar Threads

Invalud Use of Null 3
need an acDialog clarification 1
filtering a form re-visited 12
Rename Message Box 3
SetDefault 3
docmd.openform where statement not working 3
NotInList Issue 1
Modify Code on Form 2

Top