473,890 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

save table records from select tempquery

Hello group,
hope to anybodys help on my temporary blackout.
(Using Access 2003 on XP Win.)
I know how to create and edit temporary query recordset, then I can set
this data source as my form recordsource.
Until there all this work for me at a glance.

Problem case now!
For another reason I need to store my selected datas from this
datasource in another new table, can we name it as tempTable.
There I stucked right now.
I can recall, how to input records by records by using addNew method.
But absolute blackout for me - how to save whole temporary data set in
new table!
Is it possible? Hope, yes.

By using paste append?

Another question.
My form is bind to tempTable.
I also need test this table for old records each time I open my form.
Then on forms load event I can trigger my combobox routine to select
time period to use for routine selected data according selected period.
How to select and easy delete?
Should I use recordset.count and then some docmd.deleteqry methods?

I know - answers is next doors, might be anybody can help me with
direction?
Thank's in advance
Ainars.

Aug 8 '06 #1
6 2365
Turn the rowsource for form into a maketable query?

Aug 9 '06 #2
Thank You, excellent idea, now I feel much better! :)
Maketable query adds for select query operator INTO where I can point
to my TmpTable.
I will try this right now, but does this run correct in case when I
need add datas in small portions, more than only one time? Paste append
in manual mode can do this, but in VB I never used such functionality.

Ainars.

pi********@hotm ail.com wrote:
Turn the rowsource for form into a maketable query?
Aug 9 '06 #3
Me again,
just have tried make workaround from this, but stuck again, because
never done functionality like this.
Can You help with more?
My code:

Dim a As String, n As String

Select Case CmbPeriod.Colum n(0) 'this combo selects month or quarters
or half year
Case 1
n = "QSP01" '<<< this is select query name where i can aggregate column
data
....
End select

a = "SELECT 6199 as Konts, Sum([" & n & ".b50]) AS b50, Sum([" & n &
".b55]) AS b55, Sum([" & n & ".b62]) AS b62, Sum([" & n & ".b63]) AS
b63, Sum([" & n & ".b70]) AS b70, Sum([" & n & ".b71]) AS b71, Sum([" &
n & ".b72]) AS b72, Sum([" & n & ".b99]) AS b99, -1 as Fons"
a = a & " INTO TmpTable FROM " ' <<< I added INTO there
a = a & " (SELECT " & n & ".Konts, " & n & ".b50, " & n & ".b55, " & n
& ".b62, " & n & ".b63, " & n & ".b70, " & n & ".b71, " & n & ".b72, "
& n & ".b99, 0 as Fons"
a = a & " FROM " & n
a = a & " WHERE ((" & n & ".Konts) Like " & "'61*'" & " And (" & n &
".Konts) Not Like " & "6199))"
a = a & " UNION"
a = a & " SELECT " & n & ".Konts, " & n & ".b50, " & n & ".b55, " & n &
".b62, " & n & ".b63, " & n & ".b70, " & n & ".b71, " & n & ".b72, " &
n & ".b99, 0 as Fons"
a = a & " FROM " & n
a = a & " WHERE ((" & n & ".Konts) Like " & "'61*'" & " And (" & n &
".Konts) Not Like " & "6199);"

This query string actually is much much longer because repeated 20
times for each another ledger total sum!
(Why I need turn this into smaller portions?)
Does for me the following - top query part makes sum from "where"
subquery datas then with "union" I select same subquery data again and
collect this all together with sum and reflect on my form.

Now, how can I turn my string data to maketable?
docmd have not such functionalities , or I missed something?
then I found under run comands 'DoCmd.RunComma nd
acCmdQueryTypeM akeTable
but no help for me available for this.
Ideas?
Ainars.
pi********@hotm ail.com wrote:
Turn the rowsource for form into a maketable query?
Aug 9 '06 #4
"A_M_IS" <ai***@iname.co mwrote
I will try this right now, but does this
run correct in case when I need add
datas in small portions, more than
only one time?
No, "MakeTable" Queries, just as the name suggests, make an entirely new
Table.

To _add_ data to an existing Table, check Help on Append Queries.

To _change_ data in existing records of an existing Table, check Help on
Update Queries.

Larry Linson
Microsoft Access MVP
Larry Linson
Microsoft Access MVP

Aug 9 '06 #5
Thank You for Your input!
Append query help is right choice for my case. This can help.
No, I don't need edit data right in this table, but I keep in my mind
this point to next designs.

What is making most of trouble for me right on current moment?
I looking virtually to results I wished to achieve (ordered to me from
my accountant's room) and trying understand best design solution
points for this.
Picture, I trying achieving, is more alike crosstab, just more complex
on this.
So, deeper I digging, this looks more and more complex for me.

Might be experienced Access gurus can help me with pointing me on
design?

Initially I have on hand nine department tables organized on same
manner as others are.
A rows there is ledger numbers, columns is months.
A result in tables is departments planned amounts to corresponding
months.

Now I need rearrange to call those datas like crosstab:
rows stay the same, columns now should be department codes, but
filtered selection of datas should be made by time periods which can be
those same from month's columns or even complex like aggregated
quarters or half years amounts.

More or less I managed this picture via my select query (see sample
code on my earlier post), sum total aggregations and union queries.
But what if our finance analyst desired more?
- to calculate intermediate ledger group totals and input those results
next to ledger number groups as well?

There I filed :(
My screen form recordsource select query is ~10000 characters long and
I see I can double this character total count if I try achieving
desired screen result on same design manner!
Is this normal length of Query? I looked in Access specifications list
than not, but I am not sure for another - because I let this utility to
bookkeeper's room for later adjustments if they desired. I believe
they need buy then some "nutcracker " for selected edit task.
This is why I looking for another design idea, but out any for today.
Might be selecting and writing calculated inputs to TmpTable in small
portions can let me chances to call again and easy calculate running
sum totals or recall selected aggregated totals as necessary for later
grand total formulas?
Might be gurus seen the same and can point directions for me from
experiences?
Highly appreciate inputs in advance!
Rgrds -
Ainars.

Larry Linson wrote:
"A_M_IS" <ai***@iname.co mwrote
I will try this right now, but does this run correct in case when I need add
datas in small portions, more than only one time?

No, "MakeTable" Queries, just as the name suggests, make an entirely new
Table.

To _add_ data to an existing Table, check Help on Append Queries.

To _change_ data in existing records of an existing Table, check Help on
Update Queries.

Larry Linson
Microsoft Access MVP
Aug 10 '06 #6
Found part of solution for me by myself!
I asked there, how to convert VB recordsource string to executable
query.

After hours of n.g. browsing found that "currentdb.exec ute
MyStringName", I think this is what I need and browsed for there in
last days.

Never used this method before!
At least I can move ahead with my design now.
Thanks to Pietlinden and Larry Linson for spending time in assistance
to my problem!
Regards to all -
Ainars.
A_M_IS wrote:
Me again,
just have tried make workaround from this, but stuck again,
....
.... how can I turn my string data to maketable?
docmd have not such functionalities , or I missed something?
then I found under run comands 'DoCmd.RunComma nd
acCmdQueryTypeM akeTable
but no help for me available for this.
Ideas?
Ainars.
pi********@hotm ail.com wrote:
Turn the rowsource for form into a maketable query?
Aug 11 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1634
by: JP SIngh | last post by:
Hi All I am trying to plot the days off employees have taken in the selected month visually using the following code. The code below takes a long time to execute typically about 8-15 secs each time. Is there a away to optimise the code below
4
3408
by: Dexter | last post by:
Hi, I have a pro*c program that inserts records into a table from another table.This was working fine until i recently upgrade from 8i to 9i. Now the problem is it errors out frequently with ora-1400 (cannot insert NULL...) or 0ra-1458 (length inside Variable character...) But when i rerun it it goes fine, for the same records!!! I'm not able to predict its behavior.
6
130058
by: Michael | last post by:
I have two tables with a 1-many relationship. I want to write a select statement that looks in the table w/many records and compares it to the records in the primary table to see if there are any records that do not match based on a certain field. Here is how my tables are setup: Task Code Table TCode,TCodeFName,Active
1
3011
by: M Wells | last post by:
Hi All, Sorry if the subject line is too obscure -- I couldn't think of a way of describing this request. I have a table that contains approximately 1 million records. I want to be able to be able to select the top x records out of this table matching variable criteria.
36
4667
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am proposing a single column table with a field name called vehicle_type and this will contain the vehicle type. Sot it will be
3
6952
by: andreas.maurer1971 | last post by:
Hi all, since a few years I use the following statement to find duplicate entries in a table: SELECT t1.id, t2.id,... FROM table AS t1 INNER JOIN table AS t2 ON t1.field = t2.field WHERE t1.id < t2.id
20
40124
by: Guru | last post by:
Hi I have a table which contains number of rows. I want to fetch the last 5 records from the table. I know for the first 'n' records we can use FETCH FIRST n ROWS ONLY command. But i want to fetch last 5 records. Can any one help in this...
2
3267
by: kevinjbowman | last post by:
I am by no means a SQl Jedi as will be apparent by my question, but I can usually figure out a select statement on my own. I have one today though that really has me stumped. I am working in MySQlL 5. In My first select statement I get all my records from Table B SELECT `table_A`.`ITEM`, `table_A`.`DECSCRIPTION`, `table_A`.`UM`, `table_A`.`PHASE`,
4
3136
by: Bob | last post by:
Hi all, I'm trying to import data, modify the data then insert it into a new table. The code below works fine for it but it takes a really long time for 15,000 odd records. Is there a way I can speed up the processing substantially? as it currently takes about 10 minutes and thats just way too long because there is many of these imports that I need to do.... I currently insert each record one by one and I imagine thats where all the...
0
9977
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11218
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9618
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7161
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4667
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4260
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3268
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.