Yeah, i was being a bit lazy there. There is an ID field but I didn't want that to export. It's a throwback to when I was using transfer spreadsheet. Yeah, i will use the ID instead. I know i can't just refer directly to a query with parameters but can it be done with parameters with SQL?
okay, here's my actual code so far.
Private Sub cmdExport_Click()
Dim Sheet As Object
Dim strFolder As String
Dim Password As String
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If Me.includePassword = True Then
Password = InputBox("Password", "Create...
I'll try to knock together a sample db and post it here. The problem is, i have access to Access at work but no internet and at home I have the Internet but no Access.
I'm still getting stuck on the SQL. I was wondering if it would maybe be easier to make the code first open the template and save it as the new file and then do transferspreadsheet to the new file.
Hi everybody,
I've looked high and low for a nice definitive way of exporting a query to an Excel file and then saving it as a new file without saving over the original.
After a lot of fiddling and searching the internet, i've put this together (by splicing other people's code). Shockingly, it...
I finally got it to work with a mix of the code above and
doc.Bookmarks("FirstName").Range.Text= me.txtFirstName
I think I even understand what the code does now. Thank you all for your help.
I've been trying it with bookmarks with some degree of success. Still getting the hang of them though.
I found a piece of code on vba express (all credit goes to the author as I barely know what is going on in it):
Sub ExportQueryToWord()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim doc...
Can you do that and maintain all of the formatting? That does sound much easier :)
edit: I can only work out how to export it as Rich Text and it loses all of the formatting this way.
Hi all,
I'm looking to add a button to my Customers form which will mailmerge the current record to a Word template and then save the Word doc as a new file (Ideally the customer's name).
I've looked at the Super Easy Mailmerge but I can't work out how to implement it without all of the...
Sorry, the link doesn't work because it was my first post. If you take the brackets out, I think it should work.
Thanks for the link, I'll have a read through that today.
Hi all,
I'm working on a database at work at the moment just to make my job a little simpler.
My database only has one table of data so it's not complicated.
I would like to create a form that can create customisable Excel exports of the data based on set conditions and exporting only select...