[mso] Re: [SPAM SUSPECT] Re: mail merge from access

Thanks.  I have never done code, but I am going to give it a shot.   

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Bobby Heid
Sent: Thursday, September 21, 2006 12:27 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: [SPAM SUSPECT] Re: mail merge from access

Terri,

If you group your query by the name (or preferably an ID), that will put =
all of the James Jones records together.  Then you will have to loop through
= the recordset via code.  Something like:

'warning air code and pseudo code
HoldID=3D0                      'holds current ID
strData=3D""                    'holds the aggregated data

Set db=3Dcurrentdb()
Set rsOut=3Ddb.openrecordset("some table",dbopen) Set
rs=3Ddb.openrecordset("some SQL string",dbopensnapshot)

With rs
   do while not .eof
           if !ID<>HoldID then  'start a new output record
                if HoldID<>0 then       'if not on 1st record, write the
data
                   rsOut.addnew
                   rsOut!ID=3DHoldID
                   rsOut!Data=3DstrData
                   rsOut.Update
                   end if
                strData=3D""            'reset the data
                HoldID=3D!ID            'reset the ID
                else                    'same record as before
                   strdata=3Dstrdata & vbcrlf & !Data       'add the data to
the string
                end if
           .movenext
           loop

    'now we have to process the last record
    if HoldID<>0 then   'if not on 1st record, write the data
         rsOut.addnew
         rsOut!ID=3DHoldID
         rsOut!Data=3DstrData
         rsOut.Update
         end if

    end with

Rs.close
Set rs=3Dnothing
rsOut.close
Set rsOut=3Dnothing
db.close
Set db=3Dnothing

Hopefully the above pseudo code will get you going in the right = direction.

Bobby


-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On = Behalf
Of Terri Wilmoth
Sent: Thursday, September 21, 2006 12:41 PM
To: mso@xxxxxxxxxxxxx
Subject: [SPAM SUSPECT] [mso] Re: mail merge from access
Importance: Low


Thanks for the info.  My problem is the db I am working off of has = 286,000
records.  How do I get all the unit names tied to the one James Jones =
entry.
All I know to do is cut and paste and with this many records that would =
not be feasible.  Anything else that you can suggest?

Thanks tw =20

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On = Behalf
Of Bobby Heid
Sent: Thursday, September 21, 2006 11:12 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: mail merge from access

Terri,

I'd probably use a temp table so that you only have one James Jones = record
and group all of his data into that one record.  Then do the merge off = of
the temp table data.

Bobby

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On = Behalf
Of Terri Wilmoth
Sent: Thursday, September 21, 2006 11:29 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] mail merge from access


I am experienced with Access, but have a problem that I can not solve.  = I
have used various resources such as Access 2003 for dummies. =20 I am
working with a query that has multiple entries for one name.  i.e.
James Jones.  I want to send one doc to James Jones put I need data = pulled
from each entry for James Jones.  That data is all in one column i.e. =
"unit name".  Does anyone know how to do this?
=20
Thank you,=20
=20
Terri
Terri Wilmoth
Palestine, TX  75802

Email:  terri@xxxxxxxxxxxxxxxxxxx

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the
dropdown menu at the top.  This will allow you to unsubscribe your email
address or change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions.  Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: