analystkyo
IS-IT--Management
Hi all,
I've taken on the task of automating some reporting systems at work that will significantly alleviate some heavily manual database reporting processes for at least 5 of my co-workers. I don't have a background in programming but am a fairly quick learner. Here is part of the process that I am trying to work out now. I am trying to sort out the VBA code such that I can export the output from a query to a specific row in an Excel spreadsheet. I have done a fair amount of reading on VBA and I was hoping someone could help me to clear up a few questions I have regarding this process.
I understand that I am going to be referring to the recordset object of the query; my question regarding this is if it is necessary to refer to the SQL at all in the VBA or can I just simply refer to the query?
Another question that I have is that I've noticed in a lot of the code I've seen for exporting Access data to Excel, there is code written that references loop procedures; is this because each individual row of the query is being exported one at a time into the Excel worksheet object, is this necessary? Can't I just export the entire result of the query to the Excel worksheet object at once without having to use a loop control procedure?
Finally, my last question relates to referencing VBA code from a Macro in Access. If I wish to do this I use the runcode module and reference the VBA module I wish to run. I have copied some VBA code into the VBE, and pointed to the module in the expression builder; however nothing shows up in the box of the expression builder that is used to populated the function name field.
It's probably obvious that I'm a little confused and my questions are all over the place. I do appreciate anyone's input or advice they will think will be useful in helping for me to understand this better. I'm just in a bit of a rush to put all the pieces together as quickly as possible. Thanks in advance.
I've taken on the task of automating some reporting systems at work that will significantly alleviate some heavily manual database reporting processes for at least 5 of my co-workers. I don't have a background in programming but am a fairly quick learner. Here is part of the process that I am trying to work out now. I am trying to sort out the VBA code such that I can export the output from a query to a specific row in an Excel spreadsheet. I have done a fair amount of reading on VBA and I was hoping someone could help me to clear up a few questions I have regarding this process.
I understand that I am going to be referring to the recordset object of the query; my question regarding this is if it is necessary to refer to the SQL at all in the VBA or can I just simply refer to the query?
Another question that I have is that I've noticed in a lot of the code I've seen for exporting Access data to Excel, there is code written that references loop procedures; is this because each individual row of the query is being exported one at a time into the Excel worksheet object, is this necessary? Can't I just export the entire result of the query to the Excel worksheet object at once without having to use a loop control procedure?
Finally, my last question relates to referencing VBA code from a Macro in Access. If I wish to do this I use the runcode module and reference the VBA module I wish to run. I have copied some VBA code into the VBE, and pointed to the module in the expression builder; however nothing shows up in the box of the expression builder that is used to populated the function name field.
It's probably obvious that I'm a little confused and my questions are all over the place. I do appreciate anyone's input or advice they will think will be useful in helping for me to understand this better. I'm just in a bit of a rush to put all the pieces together as quickly as possible. Thanks in advance.