T
The L&L Company
Guest
Can you guys help me here...this is the code that I am using. What am I doing wrong? I am using the code to populate a text box with a string of names instead of just one.
~ Joe
******************************
Private Sub Form_Load()
Dim rstAppts As Recordset
Dim PreviousName As String
Dim strName As String
Set rstAppts = CurrentDb.OpenRecordset("qryactivityentryscreen", dbOpenDynaset)
rstAppts.MoveFirst
strName = rstAppts("fullname")
PreviousName = strName
Do While Not rstAppts.EOF
If rstAppts("fullname") <> PreviousName And rstAppts("fullname") <> " " Then
strName = strName & " - " & rstAppts("fullname")
End If
PreviousName = rstAppts("fullname")
rstAppts.MoveNext
Loop
TxtConsultant.Text = strName
TxtStatusNote.SetFocus
Set rstAppts = Nothing
'rstAppts.Close
End Sub
[This message has been edited by The L&L Company (edited 06-11-2001).]
~ Joe
******************************
Private Sub Form_Load()
Dim rstAppts As Recordset
Dim PreviousName As String
Dim strName As String
Set rstAppts = CurrentDb.OpenRecordset("qryactivityentryscreen", dbOpenDynaset)
rstAppts.MoveFirst
strName = rstAppts("fullname")
PreviousName = strName
Do While Not rstAppts.EOF
If rstAppts("fullname") <> PreviousName And rstAppts("fullname") <> " " Then
strName = strName & " - " & rstAppts("fullname")
End If
PreviousName = rstAppts("fullname")
rstAppts.MoveNext
Loop
TxtConsultant.Text = strName
TxtStatusNote.SetFocus
Set rstAppts = Nothing
'rstAppts.Close
End Sub
[This message has been edited by The L&L Company (edited 06-11-2001).]