J
JAmie
Hi
I have a Sub how takes a Form as parameter, I have to
call this Sub from a form to applicate the code so it's
take a Form as input I pass the name of the form: Me.form
But it's not working
This is my code:
The Sub:
========
Public Sub MaxSpecification(Frm As Form)
Dim intSpecifications As Variant
dim iSpecificationChoice As Variant
intSpecifications = DCount
("[SpecificationID]", "Tb_Specification", "[ItemID] = " &
1
iSpecificationChoice = DCount
("[SpecificationID]", "Tb_SpecificationParLigneCommande",
"[LigneCommandeID] = " & 1
If intSpecifications = iSpecificationChoice Then
Frm .AllowAdditions = False
Else
Frm .AllowAdditions = True
End If
End Sub
========================================================
I call the Sub from this code:
First methode:
=============
MaxSpecification(Me.form)
===
Or
===
Second Methode:
==============
Dim FrmCurrent as From
set FrmCurrent = [Forms]![FrmClient]![FrmAdress]
MaxSpecification(FrmCurrent)
Did somebody have in idea why I have the message:
Incompibale type when the compiler Arrive to
MaxSpecification(Me.form) or MaxSpecification(FrmCurrent)
Thanks
I have a Sub how takes a Form as parameter, I have to
call this Sub from a form to applicate the code so it's
take a Form as input I pass the name of the form: Me.form
But it's not working
This is my code:
The Sub:
========
Public Sub MaxSpecification(Frm As Form)
Dim intSpecifications As Variant
dim iSpecificationChoice As Variant
intSpecifications = DCount
("[SpecificationID]", "Tb_Specification", "[ItemID] = " &
1
iSpecificationChoice = DCount
("[SpecificationID]", "Tb_SpecificationParLigneCommande",
"[LigneCommandeID] = " & 1
If intSpecifications = iSpecificationChoice Then
Frm .AllowAdditions = False
Else
Frm .AllowAdditions = True
End If
End Sub
========================================================
I call the Sub from this code:
First methode:
=============
MaxSpecification(Me.form)
===
Or
===
Second Methode:
==============
Dim FrmCurrent as From
set FrmCurrent = [Forms]![FrmClient]![FrmAdress]
MaxSpecification(FrmCurrent)
Did somebody have in idea why I have the message:
Incompibale type when the compiler Arrive to
MaxSpecification(Me.form) or MaxSpecification(FrmCurrent)
Thanks