P
PayeDoc
Hello All
I have the function below in a module, but when I try to use it in a query I
get a message "Undefined function ConvertDays in expression", or when I try
to use it on a form it just returns "#error".
The sql of the query is:
SELECT staffs.practice, staffs.[ssp days], ConvertDays([ssp days]) AS Expr1
FROM staffs
WHERE (((staffs.practice)=[Forms]![frm x main]![prac name]));
The function in the module is:
Public Function ConvertDays(Days As String) As String
Dim inc As Integer
For inc = 1 To 7
If Mid(Days, inc, 1) = "Y" Then
ConvertDays = ConvertDays & inc
End If
Next inc
End Function
What have I done wrong?
Hope someone can help.
Many thanks
Leslie Isaacs
I have the function below in a module, but when I try to use it in a query I
get a message "Undefined function ConvertDays in expression", or when I try
to use it on a form it just returns "#error".
The sql of the query is:
SELECT staffs.practice, staffs.[ssp days], ConvertDays([ssp days]) AS Expr1
FROM staffs
WHERE (((staffs.practice)=[Forms]![frm x main]![prac name]));
The function in the module is:
Public Function ConvertDays(Days As String) As String
Dim inc As Integer
For inc = 1 To 7
If Mid(Days, inc, 1) = "Y" Then
ConvertDays = ConvertDays & inc
End If
Next inc
End Function
What have I done wrong?
Hope someone can help.
Many thanks
Leslie Isaacs