V
vtj
I am trying to copy a memo field from a table and paste it into a Notepad
document. The field is build in VBA to include commas and quotes. If I copy
it from the table I get "IN(""070"", ""100"", ""130"")". If I use the
Debug.Print line from the immediate window I get IN("070", "100", "130")
which is what I want to get from the table. What am I doing wrong? This is
in A2007 and the code is as follows;
Public Function MakeGFFundList()
Dim list1 As String
Dim db1 As DAO.Database
Set db1 = CurrentDb()
Dim rst1 As DAO.Recordset
Dim rst3 As DAO.Recordset
Dim rst9 As DAO.Recordset
Set rst1 = db1.OpenRecordset("FUNDS IN LLBC", dbOpenDynaset)
rst1.MoveFirst
list1 = "IN" & Chr(40) & Chr(34) & rst1![Fund_cd] & Chr(34)
detail1:
rst1.MoveNext
If rst1.EOF Then GoTo close1
list1 = list1 & ", " & Chr(34) & rst1![Fund_cd] & Chr(34)
GoTo detail1
close1:
list1 = list1 & Chr(41)
Debug.Print list1
rst1.MoveFirst
rst1.MoveNext
rst1.Edit
rst1!FUND_list = list1
rst1.Update
Set rst1 = Nothing
Set db1 = Nothing
End Function
document. The field is build in VBA to include commas and quotes. If I copy
it from the table I get "IN(""070"", ""100"", ""130"")". If I use the
Debug.Print line from the immediate window I get IN("070", "100", "130")
which is what I want to get from the table. What am I doing wrong? This is
in A2007 and the code is as follows;
Public Function MakeGFFundList()
Dim list1 As String
Dim db1 As DAO.Database
Set db1 = CurrentDb()
Dim rst1 As DAO.Recordset
Dim rst3 As DAO.Recordset
Dim rst9 As DAO.Recordset
Set rst1 = db1.OpenRecordset("FUNDS IN LLBC", dbOpenDynaset)
rst1.MoveFirst
list1 = "IN" & Chr(40) & Chr(34) & rst1![Fund_cd] & Chr(34)
detail1:
rst1.MoveNext
If rst1.EOF Then GoTo close1
list1 = list1 & ", " & Chr(34) & rst1![Fund_cd] & Chr(34)
GoTo detail1
close1:
list1 = list1 & Chr(41)
Debug.Print list1
rst1.MoveFirst
rst1.MoveNext
rst1.Edit
rst1!FUND_list = list1
rst1.Update
Set rst1 = Nothing
Set db1 = Nothing
End Function