P
Proposal Doctor
I am trying to get one of Albert's functions to work. Albert's code was
written for Access 2003. I am sure that my problem is with the periods and
bangs.
The function needs to display all people's names in the field
"PersonnelName" on the main form that appear on the subform
"subfrmProjectPersonnel" using Access 2007. I have an unbound textbox
(=ShowPersonnel) on the main form that is supposed to retrieve the
information.
What is wrong? I get the message Error#.
The function . . .
Public Function ShowPersonnel() As String
Dim rst As DAO.Recordset
Dim strText As String
Set rst = Me!subfrmProjectPersonnel.Form.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While rst.EOF = False
If strText <> "" Then
strText = strText & ","
End If
strText = strText & rst!PersonnelName
rst.MoveNext
Loop
End If
Set rst = Nothing
ShowPersonnel = strText
End Function
Thanks.
David
written for Access 2003. I am sure that my problem is with the periods and
bangs.
The function needs to display all people's names in the field
"PersonnelName" on the main form that appear on the subform
"subfrmProjectPersonnel" using Access 2007. I have an unbound textbox
(=ShowPersonnel) on the main form that is supposed to retrieve the
information.
What is wrong? I get the message Error#.
The function . . .
Public Function ShowPersonnel() As String
Dim rst As DAO.Recordset
Dim strText As String
Set rst = Me!subfrmProjectPersonnel.Form.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While rst.EOF = False
If strText <> "" Then
strText = strText & ","
End If
strText = strText & rst!PersonnelName
rst.MoveNext
Loop
End If
Set rst = Nothing
ShowPersonnel = strText
End Function
Thanks.
David