recordset results into word doc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have the following query setup in VB. and i want to use the results to
insert into a word document (have already ready set up bookmarks if needed)
could somebody please explain the best way of doing this without the use of
access tables as i want the process to be used by several users at a time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" & "Planning_DWGs_tbl.Imp_Managers_Name" & _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" & "Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" & "Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" & "Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" & "Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" & "Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" & "Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" & "Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" & "Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" & "Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" & "Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name" & _
"contractors_tbl.Agents_Name" & "contractors_tbl.Lead_Consultant_Name" &
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt Ref]))"
 
Save the string in a query, and you export the query to Word, or even merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL
 
Allan,

Thanks for your reply so far.

but would this enable multiple users to use the process at the same time for
different record sets?

Allen Browne said:
Save the string in a query, and you export the query to Word, or even merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Apples76 said:
i have the following query setup in VB. and i want to use the results to
insert into a word document (have already ready set up bookmarks if
needed)
could somebody please explain the best way of doing this without the use
of
access tables as i want the process to be used by several users at a time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" & "Planning_DWGs_tbl.Imp_Managers_Name"
& _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" &
"Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" &
"Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" &
"Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" &
"Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" &
"Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" &
"Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" &
"Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" &
"Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" &
"Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" &
"Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name" & _
"contractors_tbl.Agents_Name" & "contractors_tbl.Lead_Consultant_Name" &
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt
Ref]))"
 
If you have multiple users at the same time, presumably you have split the
database so each one has an independent front end, even though they share
the same data. If that is a new concept, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html
If the database is split, each user's query is independent of the others'.

Just to be clear, saving the query definition is not the same as saving the
records. It just saves the criteria used to retrieve records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Apples76 said:
Allan,

Thanks for your reply so far.

but would this enable multiple users to use the process at the same time
for
different record sets?

Allen Browne said:
Save the string in a query, and you export the query to Word, or even
merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL

Apples76 said:
i have the following query setup in VB. and i want to use the results to
insert into a word document (have already ready set up bookmarks if
needed)
could somebody please explain the best way of doing this without the
use
of
access tables as i want the process to be used by several users at a
time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" &
"Planning_DWGs_tbl.Imp_Managers_Name"
& _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" &
"Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" &
"Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" &
"Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" &
"Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" &
"Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" &
"Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" &
"Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" &
"Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" &
"Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" &
"Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name" & _
"contractors_tbl.Agents_Name" & "contractors_tbl.Lead_Consultant_Name"
&
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON
CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt
Ref]))"
 
Allen,

I have tried splitting the database to a separate front end as you described
but the speed of the databbase slows dramatically which the end users find
not acceptable.

hence my thought of using the record set....

Allen Browne said:
If you have multiple users at the same time, presumably you have split the
database so each one has an independent front end, even though they share
the same data. If that is a new concept, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html
If the database is split, each user's query is independent of the others'.

Just to be clear, saving the query definition is not the same as saving the
records. It just saves the criteria used to retrieve records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Apples76 said:
Allan,

Thanks for your reply so far.

but would this enable multiple users to use the process at the same time
for
different record sets?

Allen Browne said:
Save the string in a query, and you export the query to Word, or even
merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL

i have the following query setup in VB. and i want to use the results to
insert into a word document (have already ready set up bookmarks if
needed)
could somebody please explain the best way of doing this without the
use
of
access tables as i want the process to be used by several users at a
time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" &
"Planning_DWGs_tbl.Imp_Managers_Name"
& _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" &
"Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" &
"Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" &
"Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" &
"Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" &
"Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" &
"Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" &
"Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" &
"Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" &
"Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" &
"Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name" & _
"contractors_tbl.Agents_Name" & "contractors_tbl.Lead_Consultant_Name"
&
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON
CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt
Ref]))"
 
Allen,

I have tried splitting the database to a separate front end as you described
but the speed of the databbase slows dramatically which the end users find
not acceptable.

hence my thought of using the record set....

Allen Browne said:
If you have multiple users at the same time, presumably you have split the
database so each one has an independent front end, even though they share
the same data. If that is a new concept, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html
If the database is split, each user's query is independent of the others'.

Just to be clear, saving the query definition is not the same as saving the
records. It just saves the criteria used to retrieve records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Apples76 said:
Allan,

Thanks for your reply so far.

but would this enable multiple users to use the process at the same time
for
different record sets?

Allen Browne said:
Save the string in a query, and you export the query to Word, or even
merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL

i have the following query setup in VB. and i want to use the results to
insert into a word document (have already ready set up bookmarks if
needed)
could somebody please explain the best way of doing this without the
use
of
access tables as i want the process to be used by several users at a
time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" &
"Planning_DWGs_tbl.Imp_Managers_Name"
& _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" &
"Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" &
"Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" &
"Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" &
"Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" &
"Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" &
"Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" &
"Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" &
"Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" &
"Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" &
"Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name" & _
"contractors_tbl.Agents_Name" & "contractors_tbl.Lead_Consultant_Name"
&
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON
CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt
Ref]))"
 
See Tony Toews' Performance FAQ for Access here:
http://www.granite.ab.ca/access/performancefaq.htm

The benefits of splitting make it worth the effort of working through the
issues that will give you acceptable performance.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Apples76 said:
Allen,

I have tried splitting the database to a separate front end as you
described
but the speed of the databbase slows dramatically which the end users find
not acceptable.

hence my thought of using the record set....

Allen Browne said:
If you have multiple users at the same time, presumably you have split
the
database so each one has an independent front end, even though they share
the same data. If that is a new concept, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html
If the database is split, each user's query is independent of the
others'.

Just to be clear, saving the query definition is not the same as saving
the
records. It just saves the criteria used to retrieve records.

Apples76 said:
Allan,

Thanks for your reply so far.

but would this enable multiple users to use the process at the same
time
for
different record sets?

:

Save the string in a query, and you export the query to Word, or even
merge
the query if you wish.

If necessary, assign your SQL statement to a saved query like this:
Currentdb.QueryDefs("Query1").SQL = strSQL

i have the following query setup in VB. and i want to use the results
to
insert into a word document (have already ready set up bookmarks if
needed)
could somebody please explain the best way of doing this without the
use
of
access tables as i want the process to be used by several users at a
time.

cheers

Dim rsPlan As Recordset
Dim strSQL As String

strSQL = "SELECT Planning_DWGs_tbl.Auto_Number_Planning_dwgs" & _
"Planning_DWGs_tbl.Planning_Drawings_Received" &
"Planning_DWGs_tbl.Radio_Approve_Rejected" & _
"Planning_DWGs_tbl.Radio_Engineer" &
"Planning_DWGs_tbl.Date_of_Review_Radio" & _
"Planning_DWGs_tbl.Radio_Comments" &
"Planning_DWGs_tbl.Imp_Managers_Name"
& _
"Planning_DWGs_tbl.Imp_Approved_Rejected" &
"Planning_DWGs_tbl.Date_Of_Review_Build" & _
"Planning_DWGs_tbl.Build_Comments" &
"Planning_DWGs_tbl.[Drawing(1)_Number]"
& _
"Planning_DWGs_tbl.[Revision(1)]" &
"Planning_DWGs_tbl.[Drawing(2)_Number]"
& _
"Planning_DWGs_tbl.[Revision(2)]" &
"Planning_DWGs_tbl.[Drawing(3)_Number]"
& _
"Planning_DWGs_tbl.[Revision(3)]" &
"Planning_DWGs_tbl.[Drawing(4)_Number]"
& _
"Planning_DWGs_tbl.[Revision(4)]" &
"Planning_DWGs_tbl.[Drawing(5)_Number]"
& _
"Planning_DWGs_tbl.[Revision(5)]" &
"Planning_DWGs_tbl.[Drawing(6)_Number]"
& _
"Planning_DWGs_tbl.[Revision(6)]" &
"Planning_DWGs_tbl.[Drawing(7)_Number]"
& _
"Planning_DWGs_tbl.[Revision(7)]" &
"Planning_DWGs_tbl.[Drawing(8)_Number]"
& _
"Planning_DWGs_tbl.[Revision(8)]" &
"Planning_DWGs_tbl.[Drawing(9)_Number]"
& _
"Planning_DWGs_tbl.[Revision(9)]" &
"Planning_DWGs_tbl.[Drawing(10)_Number]"
& _
"Planning_DWGs_tbl.[Revision(10)]" & "CSR_tbl.CSR_Number" &
"CSR_tbl.CSR_Name" & _
"CSR_Option_tbl.Option_Name" & "CSR_Option_tbl.Radio_Engineer_Name"
& _
"contractors_tbl.Agents_Name" &
"contractors_tbl.Lead_Consultant_Name"
&
"contractors_tbl.QS_Name" & _
"FROM ((CSR_tbl INNER JOIN CSR_Option_tbl ON
CSR_tbl.Auto_Number_CSR_tbl =
CSR_Option_tbl.Auto_Number_CSR_tbl) LEFT JOIN contractors_tbl ON
CSR_Option_tbl.Auto_Number_option_tbl =
contractors_tbl.Auto_Number_option_tbl) INNER JOIN Planning_DWGs_tbl
ON
CSR_Option_tbl.Auto_Number_option_tbl =
Planning_DWGs_tbl.Auto_Number_option_tbl" & _
"WHERE (((Planning_DWGs_tbl.Auto_Number_Planning_dwgs)=" & "[Receipt
Ref]))"
 
Back
Top