Transfer a query to a excel sheet

  • Thread starter Thread starter spnz via AccessMonster.com
  • Start date Start date
S

spnz via AccessMonster.com

Hi

Can anyone help me out....

I have an excel document called Timesheets. The name of the sheet is called
WLTS.

I have headings already in rows 1 of the sheet.

Is it possible to have a command button on a form to transfer the
information from the query to the excel document I want to use?

I have tried to get this working myself but I am clueless!!

Can anyone suggest what I can do to get this working.

TIA
 
You may want to use a function in excel to query a database instead. The
help menu in excel 2003 is really easy to do this.

The other way is you can export the query to excel using the "analyze in
excel" function. You'd need to rewrite the query to include a name change in
the field names (assuming your query field names don't already exactly match
your excel field headings). To do this you'd have to add to each field name
in the query the following example of changes " OldField: NewFieldName" at
the top of each field name in the query.
 
Do your transfere from Excel. From the menu:
Data --> Get External Data --> New Database Query
Build your query there using Microsoft Query.
Hints:
If you plan to share this workbook with other users, you will have to save
the query in a folder that everyone who needs it will have access to it.
When you specify the location to save the query, use relative addressing
because not everyone has the same drive mappings.
NOT F:\SomeFolder\ExtraStuff\
USE \\TheServeName\SomeFolder\ExtraStuff\
 
Thanks guys

I have got the transfer to work how I want it to nicely.

My problem is I would like to setup code to do this task as I have users
that are basic computer users and would have problems importing the data
themselves.
If I were to have a command button it would be a whole lot easier for them.

Any ideas where I can find some code to get me started?


Thanks

Shane
 
you could try using the record macro functioni built into excel.

First do all of your steps by hand and take good notes for each step.
Next initialize the record macro function.
follow every step and when done stop the macro.
your macro which should auto code your steps is now complete.
you can save the macro in your personal.xls folder or create a button and
assign this macro to that task.
 
Back
Top