HELP PLEASE

D

DBarker

I originally posted this and had no takers so now I am
reposting. Any help would be appreciated.


Below is the code that Elwin helped me with and it works
GREAT. Now I have an additional need. I have a date
field that I want to put before each Note instead of
the ; that now goes before. I know somewhat of what this
code is doing, but I am not sure where I would place
this. Any help would be appreciated.

Debbie
----------------------------------------------------------


Public Sub Combine()

Dim strSQL As String
Dim dbs As DAO.Database
Dim rstFr As DAO.Recordset
Dim rstTo As DAO.Recordset
Dim varNoteBatch As Variant

Set dbs = CurrentDb()
strSQL = "SELECT STi_Table.* " _
& "FROM STi_Table " _
& "ORDER BY CaseID"
Set rstTo = dbs.OpenRecordset(strSQL, dbOpenDynaset)
strSQL = "SELECT STi_Multiples.* " _
& "FROM STi_Multiples " _
& "ORDER BY CaseID"
Set rstFr = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Do Until rstTo.EOF
varNoteBatch = Null
strSQL = "[CaseID]=" & rstTo!CaseID
rstFr.FindFirst strSQL
Do Until rstFr.NoMatch
varNoteBatch = varNoteBatch & "; " _
& rstFr!Journals
rstFr.FindNext strSQL
Loop
rstTo.Edit
rstTo!Journals = varNoteBatch
rstTo.Update
rstTo.MoveNext
Loop

rstFr.Close
rstTo.Close
Set rstFr = Nothing
Set rstTo = Nothing
End Sub




..
 
M

Marshall Barton

Change one line to something like:

varNoteBatch = varNoteBatch & "; " _
& rdtFr!thedatfield & " " & rstFr!Journals
 
J

John Vinson

I originally posted this and had no takers so now I am
reposting. Any help would be appreciated.


Below is the code that Elwin helped me with and it works
GREAT. Now I have an additional need. I have a date
field that I want to put before each Note instead of
the ; that now goes before. I know somewhat of what this
code is doing, but I am not sure where I would place
this. Any help would be appreciated.

Just use the Format() function to convert the datefield to a text
string and include it:
Debbie
...
Do Until rstFr.NoMatch
varNoteBatch = varNoteBatch & Format(rstFr![datefield], "mm/dd/yyyy;") _
& rstFr!Journals
rstFr.FindNext strSQL
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top