i can creat a querie but how can i save it to a new table . would like to use a macro.
i can creat a querie but how can i save it to a new table . would like to use a macro.
Why do you need to save query? This would be a MakeTable query.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
ok i am very new to this can that be done with a marco
Probably, I don't use macros, only VBA. The query would be built with the Access query designer, then macro code could run it.
Again why is this necessary? Usually no need to save data produced by a query into another table.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
well what i am tring to do is have one table pull the information from it and save the information so i pull that information up lets say 2 day latter then change that data and save it but keep the old data in a file
What is it you are changing? Filter information? Still see no need to save another table. That is bad design practice. Can always revise the query with the older filter criteria to review that output again.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
it will be part of the records not the filter info . what i would like to do is save this quary to a file so it can be retreived againg and do anouther quairy make chages to the records and save that file .
Save to a file? What kind - Excel spreadsheet? Or did you mean to say a table? Again, a MakeTable query is how to make a a new table from a query. Access Help has guidelines on building queries. Also, on how to build macros. Search on topic 'Introduction to Programming in Access'.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
yes a new table sorry i export those table to a excel for some people to use . i now as you said make an table query but i need to automate this so anyone can just click on a button it will creat the table from the query and promt them so they can add a name to the new table . that table will be used in the futchure and pulled up by that name they gave it .
I only use VBA, not macros. Either code method should be able to run a saved Access query. You will have to research how to setup a macro to run a query. Whichever code method used, need to set the button Click event property. For VBA code select [Event Procedure] in the Click event property. Double click the ellipses (...) and this will take you to the code editor. Type code in the procedure. VBA can run an SQL statement constructed in code. Example of this from my project:The example creates a new empty table. I have never done code to create a new table from existing data. Never found the need to.Code:Dim cn As ADODB.Connection Set cn = CurrentProject.Connection 'Create the Table cn.Execute "CREATE TABLE " & Me.tbxTestNum & " (LabNum text(12) PRIMARY KEY Not Null, method text(30) Not Null);"
Again, I recommend you review the Help guidelines.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
thank you for all your help . i have decided i will need to do this a difrent way . instead of saving new table they will just need to enter all the data into one master table a querie from their . just need to find out how i can send a querie to excel know . againg it would neeed to be with a marcro or vba.
thanks againg for taking the time to help me
A query can be exported to Excel. The code can either open the export wizard or can send the data directly to Excel. Review this thread http://forums.aspfree.com/microsoft-...el-414974.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.