pooterpooter
Technical User
I have a very nice function that works well,but for some reasons in my code i want to make my function public and i get always mistaked saying that the filed branch cannot be found.Could you help me rearrange the function to be public ?
Private Function lop() , placed in the subform FOrder details extended
Dim OfficeBranch As Control
Dim OfficeItems As Control
Set OfficeBranch = Me.Controls("Branch" & (Me.Parent.office - 1))
Set OfficeItems = Me.Controls("Items" & (Me.Parent.office - 1))
If Me!size > 18 Then
OfficeBranch = OfficeItems
Else
OfficeBranch = OfficeItems / Me!pack
End If
Parent!current.Requery
End Function
Public Function lop()
Dim MyForm As Form
Dim MySubform As Form
Set MyForm = Forms!FOrderInformation
Set MySubform = [Forms]![FOrderInformation]![Forder details extended].[Form]
Dim OfficeBranch As Control
Dim OfficeItems As Control
Set OfficeBranch = MyForm.Controls("Branch" & (MyForm.office - 1))
Set OfficeItems = MyForm.Controls("Items" & (MyForm.Parent.office - 1))
If MySubform!size > 18 Then
OfficeBranch = OfficeItems
Else
OfficeBranch = OfficeItems / MySubform!pack
End If
MyForm!current.Requery
End Function