Hi all,
I am exporting Access table data to bookmarked locations in a Word document, and, after setting my recordset as a table, the approach below works fine for simple string data:
However, I get a type-mismatch error when trying to export from cells whose data were derived from multiselect listboxes, such as, for instance, racial background (say the user selects two races out of five, and the data are displayed in comma-separated format in the table).Code:m_objDoc.Bookmarks("SomeWordBookmark").Select m_objWord.Selection.Text = rs!CorrespondingAccessTableData
Before getting into specifics, my first question is about the general approach. I have a large form with about 10 subforms, and, ideally, the user could click one button at the end to export all of this data into the bookmarked locations in the Word doc. I was thinking I would be setting my recordset as a query of all the underlying tables, but given the problem with the multiselect items (and maybe even uniselect listboxes), I wonder if I should be exporting directly from the form. I'm obviously a noob, so maybe that doesn't even make sense, but the examples I have seen over the past couple hours on how to handle the multiselect issue all seem to refer to forms rather than setting a table recordset, so that's what I'm asking about.
Any advice on general direction to get me started? I'm happy to do my own research and fiddle with it for a while before posting a more direct question, so I'm certainly not asking for anyone to generate a bunch of code, but I'd like that fiddling to be a bit more productive than I have been tonight, if that makes sense.
Also for context, whatever approach I choose, ultimately, I only want to export the data for the current record, not all records (not sure if that changes the recommended approach in general).
Thank you in advance for any ideas you might have, and have a nice day or night, depending on where you all are!