I'm sure I've seen this somewhere, but I can't find where now...
I have an ms access application , and want to create a word document with a table based on a query.
I know how to add single values, and how to go over a query values, but how do I create a table that is as long as the number of the records in my query and feed its values?
I can do this very ugly with something like:and so on as long as I have records, but needless to say I don't want it this way.VB Code:
Set qdf = CurrentDb.QueryDefs("query1") qdf("my_station_no") = station_no Set rs = qdf.OpenRecordset rs.MoveFirst If rs.EOF Then goto bypass MyDoc.variables("Item1") = Nz(rs("item_type_name"), "") MyDoc.variables("Amount1") = Nz(rs("ramount"), "") rs.MoveNext If rs.EOF Then goto bypass MyDoc.variables("Item2") = Nz(rs("item_type_name"), "") MyDoc.variables("Amount2") = Nz(rs("ramount"), "") rs.MoveNext
anyway I can create an array of fields in ms word lined up in a table, or something similar?




Reply With Quote