L
Les
I am using the following code which concatinates values which I want to
write to a table.
I have problems getting the code to recognise the variable "strInitials"
(See ****** ) It seems to want a string only.
Can anyone give me the correct syntax for this.
Thanks
Les
Dim rstRecips As Object
Dim strInitials As String
strInitials = ""
Set rstRecips = CurrentDb.OpenRecordset("qryUpdate_Responsibility") 'Query
Name
If rstRecips.BOF Then 'BOF=no results from query
MsgBox "Query produced no results."
Else
rstRecips.MoveFirst
Do
strEddresses = strEddresses & _
rstRecips.strResponsibility & "," 'Email Field NAme
rstRecips.MoveNext
Loop Until rstRecips.EOF
'Insert Into Table
strsql = "Insert Into tblResponsibility (numID,strResponsibility_List)Values
( " & Me!ActivityID & ", strInitials)" *******
CurrentDb.Execute strsql, dbFailOnError
End If
rstRecips.Close
Set rstRecips = Nothing
write to a table.
I have problems getting the code to recognise the variable "strInitials"
(See ****** ) It seems to want a string only.
Can anyone give me the correct syntax for this.
Thanks
Les
Dim rstRecips As Object
Dim strInitials As String
strInitials = ""
Set rstRecips = CurrentDb.OpenRecordset("qryUpdate_Responsibility") 'Query
Name
If rstRecips.BOF Then 'BOF=no results from query
MsgBox "Query produced no results."
Else
rstRecips.MoveFirst
Do
strEddresses = strEddresses & _
rstRecips.strResponsibility & "," 'Email Field NAme
rstRecips.MoveNext
Loop Until rstRecips.EOF
'Insert Into Table
strsql = "Insert Into tblResponsibility (numID,strResponsibility_List)Values
( " & Me!ActivityID & ", strInitials)" *******
CurrentDb.Execute strsql, dbFailOnError
End If
rstRecips.Close
Set rstRecips = Nothing