Parameters

  • Thread starter Thread starter Simon
  • Start date Start date
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
 
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
 
I have to ask the obvious question.

Do you have a form named Frm_Test in your database?
 
Yes
the command with the problem is the "Forms(FileN).Allowadditions=True"

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