Populating Temp Tables
Jan 28, 2005
Here's the scenario:
I create a temp table structure, which works fine.
I create a recordset from SQL pulling data from a DB2 connection. This works fine.
I want to put the entire recordset result into the temp table.
I have a working means of doing this, but it is very inefficient and leaves the user staring at an hourglass for a minute or two.
What I am currently doing is iterating through each record of the recordset and appending it to the temp table. Desired results, yes, but takes way too much time.
Is there any way to simply 'dump' an entire dataset into the table, instead of on a record-by-record basis?
Here's some code from how I am currently doing things:
Set cmdP1 = New ADODB.Command
Set cmdP1.ActiveConnection = cnnP1
cmdP1.CommandText = "SELECT DISTINCT distribution_id FROM " & sDB & " ORDER BY distribution_id"
Set rstP1 = cmdP1.Execute
Do Until rstP1.EOF
With rst_Temp
.AddNew
.Fields!distribution_id = rstP1!distribution_id
.Update
End With
rstP1.MoveNext
Loop
Any help will be most appreciated! Thanks!
John
View Replies
ADVERTISEMENT
Dec 15, 2014
I'm looking into storing query data in temp tables for my reports run better. From what I'm reading, it seems best to have the temp tables in a separate db, and to break the links to avoid bloating of the FE database. I'm unsure how to do this with VBA, especially since my temp database will be password protected. When do I break the link - when I close the FE database?
View 14 Replies
View Related
Oct 23, 2014
I'd like to copy data from an excel spreadsheet and paste it into a temp table in Access and then hit a button which will run an append query and append all the data in the temp table to a permenant table.ow to create a temp table?
View 3 Replies
View Related
Oct 9, 2013
All using access 2010. I have a multiuser database that I feel would benefit from splitting into a backend with multiple user frontends. My problem is that there are tables from make table queries processed every two weeks that all users need access to. As far as I know; you can not put a table in the backend that you will delete and remake or a temporary table and link to it in the front end. Is there any other way I would be able to split the database and have temporary tables linked from backend to frontend that I am not aware of? Is there another way to creating temporary tables and tables from make queries? This database has 9 users and counting and really needs to be split. r
View 14 Replies
View Related
Mar 29, 2013
I have a feed from ODBC to Access DB. I need to populate several new tables with the contents of the original table. I know I'm being stupid but it's been a long week.
View 1 Replies
View Related
Apr 12, 2013
I've got a working database with pretty good structure etc. How I would go about creating 3 prepopulated records on a many side of a relationship on entering a new record in the one side of the relationship.
View 6 Replies
View Related
Nov 23, 2012
I have 2 tables tblworkdone and tbltests, both have a date field and are both subforms in a tabbed form on the main form. When I enter a date into the tbltests subform I would like the date to automatically be entered into the tblworkdone date field and create a new record so that when I move to the tblworkdone subform with the date already there.
View 5 Replies
View Related
Jun 29, 2007
I have created a query from two tables. One table is Job information the other is job notes. How do i populate the query with the job # and job prefix from the job information table? I have the query(field) structure I want but its just gives me blank fields in the query form. How do I populate the fields with the info from the tables?
Thank you!
View 3 Replies
View Related
Dec 8, 2004
I have two tables created. One contains only names of people, the other contains the names along with other information stored about those names. The names consist of first, middle, and last on both forms, but for some reason, I can only get the middle name onto the names only table and not onto the other table with all the other information. if you'd like to see the db I have it posted to yahoo briefcase, just send me a message for the username and pw.
View 9 Replies
View Related
Apr 4, 2013
I have two tables in my Db: tblMaster & tblAddresses. They are joined with a one-to-many relationship, with the addresses being the "one" side. Many entries in tblMaster have the same address.
I use a form, based on a query, to add records which creates the new vendor in tblMaster, and (if I have contact details), a record in tblAddresses. The problem is that while the PK is created in tblAddresses once I add the address info, the related FK field in tblMaster is not populated with that #.
View 5 Replies
View Related
Nov 8, 2004
I haven't used access for a long time so I am very rusty.
I have a few tables but I'll just use two for an example:
Table A
Ticket No
Part No
Defect Code
WorkCenter No
Clock No
(Ticket No is Primary Key)
Table B
Clock No
Supervisor
Employee
(Clock No is Primary Key)
Is there a way for me to create a form, that when Clock No is entered it will be placed in both tables?
Thanks in advance.
View 2 Replies
View Related
Oct 31, 2004
I am trying to create a database which will act as a timesheet and management system.
I have several tables set up. some are:
01-Staff details containing Staff ID, Names, etc
11-Timesheets containing Timesheet ID, Staff ID, Timesheet Period ID
17-Timesheet Periods containing Timesheet Period IDs, Start Date and End Date.
13-Hours containing Hours ID, Timehseet ID, Project ID, Hours
etc.
I want to set up a Combo that lists Names from Table 01-Staff Details, and when the user selects their name, enters the Staff ID on a new row in the tabll 11-Timehseets.
I am able to create the Combo to list the names from 01-Staff Details, but am not able to get the selected name to jump into 11-Timesheets. The field is not available in the Control Source.
Could you please assist? I am not an Access expert, nor have I done any programming, so a step-by-step solution would be greatly appreciated!!
Many thanks in advance
Sunil
p.s. I would then like to ensure that users can't edit data in certain tables (eg. they shouldn't be able to create a new Staff ID/name, etc)
My next task will be to create a sub-form (which I am able to do) where the user can select a project from a combo-box and enter the hours worked on it. I would like the project and hours to be entered on a new row under the table 13-Hours
I look forward to your reply!
Many thanks
View 4 Replies
View Related
Nov 16, 2013
i have made two tables with data from an excel sheet. The excel sheet has many duplicates and im trying to eliminate this. The tables are:
tblTasks and tblTeam. Both have autoincrementing primary keys, and the tblTasks table has the TeamID (primary key from tblTeam) as a foreign key.
My question is, how do i populate the TeamID field via perhaps a query, as it is blank on all records. I have over 5000 tasks so a manual approach is what im trying to avoid. A sample of the fields in the tables is as follows:
tblTasks
TaskID - PK
Task Name
Team ID - FK
tblTeam
TeamID - PK
Team Name
there's also a Staff table. tblTeam has a one to many relationship with the Staff table. tblTeam also has a one to many relationship with the tblTasks table.
View 3 Replies
View Related
Aug 1, 2012
I have an Access 2007 database with two tables (I will call them table 1 and table 2)
Both tables contain the same two fields. (I will call the FirstName and LastName)
Table 1 has an associated Form where the user enters the two names. When the value in either one of the two fields in Table 1 change I want the corresponding field in Table 2 to automatically update with the same value that were entered in Table 1. Basically I want Table 2 to automatically replicate the same data in Table 1. So if I type the text "John" into the FirstName field in Table 1 then the FirstName field in Table 2 will automatically update with the text "John"
I am new to access and am struggling with the automatic updating.
If the automatic part is too hard then I will be happy to attach the update action to a command button.
I have uploaded my database file with the two tables for reference. I want to get the fields (for all records) in table 2 to replicate table 1 so that when table 1 updates table 2 values changes to show the same text.
View 3 Replies
View Related
Nov 14, 2012
I need to make one database with information about torque values according to one defined table. I make 3N so I can avoid duplicating data, by my problem now is how to enter data into the related tables and save the data using a save button. I want to have control about when data is saved that is the reason because I used unbound controls to enter data and I want to use also a new button to add new records.
View 11 Replies
View Related
Nov 23, 2012
I have created a database which has 9 tables, the first table being the contact information, but in all tables there are fields for firstname, lastname. Is there a way when you enter the firstname/lastname fields into the main table that it can populate the same information in to the same fields in the other tables? If so how?
View 5 Replies
View Related
May 30, 2013
I have the following tables:
Inquiry (This is the main table I want to populate through the use of a form)
Programs
My question refers to two columns in the Inquiry Table
Program
Group
The program column is populated by a drop down menu that is linked from a programname column in the Programs table.
I I want is the Group column in the Inquiry table to autopopulate based on the selected programname (There is a group column associated in the Programs table) so the form field will be autopopulated.
What I have tried is autopopulating the form (form name is Inquiries) Field called Group by using =[Program].[Column](1) in the source code of the text box. This works well, but it then does not populate the main table.
I need to either
- Learn how to populate the main table column called Group based on the form autopopulating
or
- Learn how to autopopulate the column Group in in the table so the form will autopopulate
View 3 Replies
View Related
Jun 9, 2014
I have created two tables. One table list of 100 Categories that I monitor each month. The Categories are never changing month-to month, however, each might be associated with a different client month-to-month. Presently, I am manually typing in the Client information month-to-month with information pulled from the Client's table. The Client's table has a Category Field which is populated when a Client has purchased space to use it.
In essence, I have the Category Table (Fields: Record Number; CategoryName; Client Name; beginning date the client will use the Category and Ending Date the client will stop using it). The Client's Table has a lot more fields/information but it still has the same fields as the Category Table. I am trying to be able to use the Category Table and have it automatically populate with the client who is using the Category at that time. Any Category not being used by a Client then the Query should write "Open" in the Client's name field. I have tried many different scenarios but can't seem to get it to work. I must see all 100 Categories each time I run a report. It doesn't have to say "Open" but where ever a client did not use the Category it should be left blank.
View 1 Replies
View Related
May 20, 2015
I have created 2 tables: Client and Routing.
Each client record is unique. A client can have 'several' routing records.
Key field in Client is 'Client ID'.
Routing table has foreign key of: Client IDFK
I created a relationship of one to many from Client table 'Client ID' to Routing table 'Client IDFK'.
I created a form for the Client table and works.
Where I am having issue is: Client data is not populating into the following Routing form.
* I want a 'Routing form' that you can lookup client info and place it into that form.
* The bottom of the form will be all the routing table fields. The new routing info will be entered into it.
My client needs that form printed for the driver. Client will have many routing forms(records) but only one client record. The driver will have one completed form for each time he picks up client.
View 3 Replies
View Related
Nov 8, 2005
Hey all, I was thiking can i make a blank query and then on my filtered form. Pass the data from the selected fields(VIA a ceckbox) and then display a report based on that query? Then have the query cleared for the next time?? Is this possible? Thanks in advance for any help!
View 14 Replies
View Related
May 22, 2007
Hi there - on one of my forms i have a text box where the user can write the contents of a letter. When a button is pressed, a report is run, and the text from the form is entered into the report -
this all works fine - but when the text reaches a certain length, it goes all unreadable. SO i assume this use of a temp variable (as its not being stored in a table) comes with a text limit? Is there anyway to extend this?
Cheers
View 9 Replies
View Related
Nov 4, 2005
Is it possible to have a form that will filter my data to what i need, and place in a temperary table and then be able to display it in a report??? So I already have a filtered form, however I would like to be able to creat reports on the fly. So I will not need all my fields from my table everytime I filter. So If I create a report I can choose the fields that I need, however this is done will all records in my table and I would like to only use the data I have filters. What way would be best to accomplish this?? I already have the ability to load the report wizard by a command button. I just dont know the best way to use my filtered data with it. Any help would be great. thanks
View 4 Replies
View Related
Nov 24, 2006
I have just been working with some temporary recordsets in access 2000.
After working with the recrodsets each is closed and set to nothing but this leads to bloating of around 20Mb on a 70Mb backend database.
So I (in messing around) I added "DoEvents" after closing each temporary recordset and the bloating reduced to just 8Kb.
Is it normal practice to force the closure of temporary recordsets before moving to the next step using DoEvents, because this certainly seems to be suggested by this result?
Vince
View 2 Replies
View Related
Oct 2, 2006
Hellooo
Hi gurus
I have a smallish problem
I have two tables that I need to join togther - normally no problem
I have one table with 1 event on it- easy
however if I have more than 1 event on it I have another table that opens up and I add multiple evnets to it
main id number 12345 with 1 event on it and
23456 may have 20 events on it
on my other table (with multiples on it) i have this autonumbered (this is great unique id - now i need to make a temp table to include boths sets of data in one file
1 event table - easy
multi event tabel I want it to get the main refernce fromt he first table (using 23456 as the example) and have it list these in the table - main refer 23456-multi table unique ref number 23456-1 , 23456-2
so my table should have
12345
23456-1
23456-2
23456-etc
I have been using append qry to make tables - any pointers would be great
GP
View 4 Replies
View Related
Mar 28, 2005
Hey all-
I'm trying to create a simple 1 field temp table to populate a combo box with the name of the current user and the word "Company." However, after the user closes the form (or as soon as the Temp table is no longer necessary) I would like to delete the table. I can create the table, the fields, add the data, and populate the combo box just fine, but I'm having problems deleting the table after I'm done. I keep getting the error:
Run-Time Error 3211: The database engine could not lock table 'Temp' because it is already in use by another person or process.
here's my code:
Code:Option Compare DatabaseDim dbRoofing As DAO.Database Private Sub Form_Close()dbRoofing.TableDefs.Delete "Temp" 'where i get caught when i close the formEnd Sub Private Sub Form_Open(Cancel As Integer)Set dbRoofing = CurrentDb Dim tblTemp As TableDefDim rcdTemp As DAO.Recordset Set tblTemp = dbRoofing.CreateTableDef("Temp")tblTemp.Fields.Append tblTemp.CreateField("Owner", dbText)dbRoofing.TableDefs.Append tblTemp Set rcdTemp = dbRoofing.OpenRecordset("Temp", dbOpenDynaset)With rcdTemp.AddNew!Owner = CurrentUser.Update.AddNew!Owner = "Company".Update.CloseEnd WithOwner.RowSource = "SELECT Temp.Owner FROM Temp"End Sub
thanks guys
View 2 Replies
View Related
Feb 25, 2006
Hi all,
I have a form with around 10 checkboxes which serve as a filter option...now, when I hit my cmdFilter button it works well with a simple MsgBox !Ime showing all the filtered names...now, I want to put the results into a table tblTemp so that I could show the results in my subform. I've tried with making a sql string something like "INSERT INTO tblTemp..." but it's still empty.:confused:
Since this table will serve as a one time data, I will need to delete all records when I hit the Filter button next time...so, how do I send my recordset data into my table.
I hope this sounds understandable...
Thanks a lot,
Daniel
View 14 Replies
View Related