Inserting Records To Two Tables At The Same Time

Jan 31, 2008

hi all,
I have created the database with multiple tables. I've created one main table to store all records from other tables. Then I have make several forms to enter record into several tables.
What I'd like to make is that when I enter new record to any one of those other tables, then it will be automitically add to the main table also. The record no of main table will be automatically increase by itself when the new record came in.
Can anyone help me with it?
thanks.

View Replies


ADVERTISEMENT

Inserting Date & Time

Oct 14, 2004

The pest again!!
Please could you tell me how to insert the time into a form?
I have managed to get the date to work using:-

Private Sub Complete_Click() ((This is a yes/no field))
Me![DateComp].Value = Date
End Sub

Private Sub OrderNo_AfterUpdate()
Me![DateOpen] = Null
If Not IsNull(Me![OrderNo]) Then
Me![DateOpen].Value = Date
End If
End Sub

However if I include my [Time] field naught happens.

My format in the field is "Short Time"

Thanks again,
Brian.
Zimbabwe.

View 2 Replies View Related

Automatically Inserting Current Time

Nov 11, 2007

I am trying to get the current time to display in the same record as an identity number.
I am using a barcode scanner to identify the ID number. Using a program called BC Wedge it will place the ID number into a field in a table of the database. I also want it to record the current time the ID number was scanned.
I tried setting the default value of the 2nd field to Now(), however this does record the current time, but in a new record. This basically gives me a list of ID numbers from the barcode scanner and a list of recorded times, however all the times are one record out.

Is there anyway to get the recorded time to be placed in the same record as the ID number?

As far as I am aware the BC Wedge software needs to have the table in table view, although I may be wrong about this.

Hope somebody can help me with this.

View 4 Replies View Related

Inserting A Record With A Date/time Field

Feb 2, 2005

Hi,

I'm trying to insert a record into an Access database from some ASP Code.

I have:

...
strSQL = "INSERT INTO tblUser (UserID, Date, Comments) VALUES " & _
(" & nID & ", #" & Now() & "#, " & "''" & strComments & "');"
conn.Execute(strSQL)
...

I'd have thought this should work but it doesn't.I just get a "Syntax error in INSERT INTO statement".

My date field, called "Date" (just in case that's a problem!) in my database has no input mask defined, it's just a basic date/time field. I've tried replacing the '#' symbols with single quotes, and doesn't work either. I haven't had any luck finding a definitive example of how to do this, even though it's trivial surely. All the similar examples I've found talk about how to update a record set with a date, or how to set the system locale, etc.

Any ideas as to what I might be doing wrong?

View 1 Replies View Related

Tables :: Field And All Records Change Same Time?

Mar 12, 2015

I need to change my all field information at the same time. For example :

FIELD
a
a
a
a
a
a

This is my field and i want to change there b instead of a (of course there is 5000 records)

Is that possible ? how can i do that ? or can i change at the same time 1by1 its not an option.

View 2 Replies View Related

Tables :: Limiting Number Of Records At A Time

Sep 9, 2014

I'm trying to create an Access database for my college so that our call centre can allocate students to a specific interview time/date. The problem I'm having is that each interview slot must only have a maximum of 10 students at a time.

I'm creating tables for the student details, address and for each interview slot available.

I'm using Access 2010.

How I can limit the number of records in a table to 10 so that when that interview slot is full it informs the user?

View 14 Replies View Related

Inserting Records...

Aug 4, 2005

Ok, I know this is already part of another thread, but my problem is a bit more complex...

The database I've been designing catalogs traffic signal equipment at every intersection in a 12-county area. There's about 480 intersections in the database. My boss pointed out the need to have the intersections listed in geographic order. For example, if I have three intersections on IL Rte. 5 - John Deere Rd, Bauer Parkway, and Industrial Park Rd, they need to be listed in the order in which they exist on the road (from east to west or north to south). Alphabetically, the intersections would be Bauer, Industrial, John Deere. But, as you drive down the road (from east to west), the intersections occur as Industrial, Bauer, and John Deere.

I can sort the intersections according to their "corridors" without any trouble, but I have to force the geographic order of the individual intersections by assigning each an index value (like "1", "2", and "3"). Better yet, I can assign the indices in multiples of 10, 100 or 1000, (1,2,3 becomes 10,20,30 or 100, 200, 300, etc.) and guarantee there will likely always be a sequential position available in the geographic index for a new intersection. Plus, I can always pick the "middle" of the range for each new insertion. For example, if Bauer has a geographic index of 200 and John Deere's is 300, then I can give Zebulon a value of 250 - leaving equal room for insertions before and after Zebulon in the future.

Pulling this off isn't hard - I know how to do it. The problem is running out of positions in the index. In the case of my database, it is unlikely we'll ever add more than two or three intersections between two existing ones, so using multiples 100 is probably best. In this case, I can add at least 6 intersections before I run into the possibility of having two intersections whose indices have a difference of only 1. Using 1000, the value goes up to 9. Each multiple of ten gives you 3 more entries (minimum) before encountering consecutive indices. I guess the inherent problem is figuring out a more "infinite" way of accomplishing this. I don't readily need it, but on the off chance that I do end up with consecutive intersections (that I have to insert between), it'll require manual re-numbering to fix the problem.

That's my solution, but there may be something simpler. Any thoughts?

View 7 Replies View Related

Inserting The Records Into The Table

Oct 31, 2006

Hi!
Please, please, please help me!
I have created a form that should get Date, Day inputed by a user. Then it must place 8 the same records in the table.
Any help will be appreciated
Thanks in advance

View 2 Replies View Related

Missing Records When Inserting

Feb 5, 2008

Hi!

I hope this is the right section for posting this Q.

I use Access 2003 on WinXP pro as front-end & for back-end a MySql on a Linux server. I use MyODBC to connect to the back-end and all the tables are on the back-end. The workstation is connected to the server via VPN (so the server and the station are on different locations).

Quite often I get a problem that not all records are inserted into a table. E.g. I have like 5 - 15 records (up to 10 fields) in one table and I want to transfer/copy them to another:


strSql = "INSERT INTO tblDetailNakup " & _
"SELECT tblDetailNakupTemp.* " & _
"FROM tblDetailNakupTemp;"
docmd.runsql strSql


most of the time it works OK, but from time to time a couple of records are missing.

What could be the problem? Is there any way for somekind of a check, if all has been inserted otherwise the query is repeated?

TNX in advance,
Miha

View 2 Replies View Related

Inserting Records VIA Form

Aug 31, 2005

Hey guys, got another question for you.

I have a table that has the follow fields (this is for a mailing schedule)

Job Name, Mail Date, Job Number, ID #, Material Due Date, Quantity To Mail

Here's the problem I'm having.

For each "Job" that we have, it can have multiple "Mail Date(s)". I'm trying to create a form that will allow a person to enter one "Job Name" and multiple "Mail Date(s)" and have it create a total number of records based on the number of "Mail Date(s)" (total possible is 4). Example below.

I'm creating a mailing for "Free Hot Coffee", I enter the "Job Name" once, and enter 4 "Mailing Date(s)", then click a button and have Access add 4 records for "Free Hot Coffee" each with a separate "Mail Date"

Is this possible? If so how? I was thinking of using a For loop but didn't know if it was possible.

Thanks in advance.

View 3 Replies View Related

Form Inserting Into Both Tables?

Nov 15, 2006

Hi,
I have a problem with a form based on a query. It draws content out of the table Repairs, and also shows the customer info for each repair (based on the link between CustomerID field in both the Repairs table and the Customers table)
But when I add a new record using the form, a new entry is added to both tables.
Can anyone please explain why this happens and how i can fix it?
I dont want a new entry in the Customers table, only in the Repairs table.
Hope this question makes sense.
Vauneen

View 1 Replies View Related

Inserting Records Into A Table Through A Form

Jan 28, 2006

Hi all,
Really, I am very happy to be a member in this great forum with those great members....

I have a form with three text boxes and one button "Submit". This form is build based on a table with three columns. How can I insert records into this table through that form by clicking that button "Submit"....


Thank u and sorry 4 bothering u....

View 7 Replies View Related

Inserting Records Into A Table Through A Form

Aug 1, 2006

Hi all,
Really, I am very happy to be a member in this great forum with those great members....

I have a form with two text boxes and one button "Submit". And also, I have a table with two columns. How can I insert records into this table through that form by clicking that button "Submit"....
I think it is simple, but I am very beginner in Access....
See the attached file....

Thank u and sorry 4 bothering u....

View 6 Replies View Related

Inserting Multiple Records Into Table At Once

Mar 4, 2015

How does one get multiple records inserted into a table at once, when you press the "Add Record" button? Resulting in the table below:

MAKE
MODEL
GAS / ELECTRIC
COUNT
YES / NO

Honda
Accord
Electric
1
YES

Honda
Accord
Gas
3
YES

Honda
Civic
Gas
0
NO

Ford
Mustang
Gas
4
YES

This is how it must be setup, all I need is to know how.

View 5 Replies View Related

Inserting Data Into Two Tables - Urgent

Nov 7, 2006

Hi, this dilemma really has me in a bind - say I have table1 and table2, when I enter data/update table1, I need to also enter the same data into table2. I know this sounds royally weird, but if there is a way to do this I would appreciate any and all help asap!

Thanks in advance.

View 3 Replies View Related

Inserting Values Into Multiple Tables

Aug 22, 2005

I am using an unbound form to insert data into several tables, all related, at the same time. Please let me know if what I am trying to achieve is too ambitious!

I am developing a material sample library... any sample could be one material, two materials or three materials. Let us say that A, B, and C are three primary materials.
I have three Tables: tblX, tblY, tblZ.
tblX stores details for each individual material. Its structure is as follows:

tblX
XPK | ID | value1 | value2 |
01 | A | asdfas | asdfdf
02 | B | dfasdfa | sdfaf
03 | C | asdfffd | asdfg
(here, XPK is the primary key, ID is the name of the material and value1, vlaue2 are other descriptive fields...)

tblY stores materials that are combinations of two primary materials:
tblY
YPK | 1st | 2nd | ID | value1 |
101 | 01 | 03 | M | keiury |
102 | 02 | 03 | N | kjgeiih |
103 | 03 | 01 | P | djlkgoi |

(here, YPK is the unique ID for a sample, the '1st' and '2nd' fields are simply the primary keys from the tblX. ID is the name of this new material and value1 has descriptive values for samples M, N, etc.)

tblZ is the next level of material, made of combinations of materials from both tables tblX and tblY. it is like this:

tblZ
ZPK | 1st | 2nd | 3rd | 4th | ID | value1 | value2 |
1001 | 01 | 03 | -- | -- | R | asdprw | mnvd |
1002 | 01 | 102 | 02 | -- | S | adsfd | oirtyr |
1003 | 103 | 02 | -- | -- | T | werwq | pojfgr |
1004 | 02 | -- | -- | -- | U | alkfdp | uioite |
1005 | 01 | 02 | 103 | 102 | V | keqwei | oirewj |

(here, ZPK is the unique identifier, the primary key. as you can see, 1st, 2nd, 3rd, 4th are references to materials from either tblX or tblY or none, ID is the name of the material and so on.)

So, going back to the original primary materials, a sample could be a combination like A + (A+C) + B...

I hope I am clear enough till this point.

My unbound form (which is a very complicated one by now!) is where a user will start with such a sample and start putting in details for each of the primary materials. As he/she logs each individual material, I store that data in a temporary table (tbltemp). When all the primary materials are fed in, the user hits a 'Save' button, which is supposed to do the following:

1) save each primary material from tbltemp to tblX
2) extract their primary keys and then insert that into the next level table, either tblY or tblZ.

I have been working with ADO recordsets to 'addnew' data to tables and am adept with that. I have never simultaneously extracted data from one table and inserted into another. similarly, i have never extracted more than one record, and inserted them into a single record in another table, etc.

I will appreciate any guidance, both at conceptual level and at operational level, that I can get. If you would like to see my database, I could arrange to have it accessible; there is nothing confidential (only higly complicated, I think!).

If you are still reading, I already owe you a ton of thanks!!

View 7 Replies View Related

Forms :: Inserting New Records With Button In Subform

Jul 25, 2013

I have a database consisting of two tables. One table is meant to be a running log of entries (Table A) and the other is simply used to house specific information relating to certain records (Table B). There is a form within the database that is used for data entry. Within that form there is a subform that has a button that will automatically insert a new record into the running log (Table A). This button currently carries over one value (a Doctor's ID) but I also need this button to begin carrying over my employee's name as well. I have tried numerous times and I can not get this second value to carry over.

View 1 Replies View Related

Inserting Photos As Records In Access 2003

Sep 6, 2012

I have created a tabel in access 2003 which has information about employees and i have to put even their photos as records so i can see them in a report that i have created too.

View 5 Replies View Related

Inserting Data From Two Tables Into Another Table Using A Form

Oct 22, 2007

I am new to access (using Access 2003) and am having trouble working with forms. Here's what I want my form to do:

-Use a combo box to select a specific system
-Given the selected system, pull up ID numbers and descriptions (in separate text boxes) from two separate tables corresponding to that one system
-Navigate through those ID numbers/descriptions from each table independently to find ones that match
-Store the ID numbers of the ones that match into another linking table

The biggest problem right now is being able to navigate through the different table ID numbers/descriptions and add both ID numbers to a row in a different table. I've tried using a combo box with the INSERT INTO statement into the code builder, but I keep getting syntax errors.

Does anyone have any suggestions on a better way to do this?

Thanks!

View 3 Replies View Related

Forms :: Inserting Multiple Records From Form Into Table?

Jun 18, 2014

I have a tabular form with many rows of records. Users add some additional information and now I would like to insert it into a new table.

I tried to use below code and it works but it inserts only first row out of many. So I just wonder how to amend it to insert all data?

Code:
CurrentDb.Execute "INSERT INTO [PO Lines - Table] ([SKU], [SKU Description], [Barcode], [Qty], [Unit Price], [PO Number], [Range])" & _
" VALUES ('" & Me.SKU & "','" & Me.SKU_Description & "',''" & Me.Barcode & "''," & Me.Qty & "," & Me.Unit_Price & ",'" & Me.PONumber & "','" & Me.Range & "')"

View 12 Replies View Related

Inserting Time Into Access 2010 Query Field When Character Is Entered In That Field

Mar 4, 2015

Here is what I am trying to do. I have a query with 2 fields. "Time In" & "Time Out". What I would like to happen is this. Whenever a character, let's say a "t", is entered into that field I would like the current time to populate that field. Right now we are actually typing in the time. I have the fields set up as DateTime fields currently.

View 10 Replies View Related

Queries :: Query For Inserting Random Records Into Temporary Table

Jul 16, 2015

I'm trying to insert 10% of a dataset from dbo_billing into another table Random_Temp. Another form is open when this query is to be ran that passess in the billyear and billmonth... I'm sure it's a syntax issue as I can isolate the random number part and it displays the appropriate data, I just can't re-write it to insert into the other table:

INSERT INTO Random_Temp ( indx, peopleId, audited )
SELECT TOP 10 PERCENT b.indx, b.peopleId, b.audited
FROM dbo_Billing AS b
WHERE (((b.billYear)=[Forms]![billing]![billyear]) AND ((b.billMonth)=[Forms]![billing]![billmonth]) AND ((b.recertifying)=-1))
ORDER BY Rnd(-(1000*b.indx)*Time());

View 2 Replies View Related

Tables :: Inserting Foreign Keys Within A Text Field?

Aug 28, 2013

I've got a table - "Products" - in my database, with a text field - "Info" - which contains info about products.

Within this field I would like to have footnotes. To do this, I think the best way to do it is by putting numbers inside the text at the location of where I want the footnote to refer to. These numbers will actually be foreign keys to a table called 'Footnotes'.

I can then program the forms and reports to show any numbers as superscripts or whatever.

(Of course, if the user will actually want to insert a number into the text field which is NOT a reference to a footnote, I will have to make a workaround e.g. by making access put a symbol in front of the number, so access will know the number is just part of the text (and I will program the form to not show the symbol in front of the number)).

Is it wrong to have foreign keys within a text field? I think if executed correctly, it should work perfectly.

View 8 Replies View Related

Tables :: Inserting Hyperlink In Field Title On A Table?

Dec 7, 2012

Is there a way to insert a hyperlink in a field title on a table? For example, I have a field that is a check box for whether the person has taken a class. What I would like to do is insert a link in the field title for that class so I can click on it and bring up the supporting documentation in a PDF file for that class.

View 4 Replies View Related

Modules & VBA :: Inserting Multiple Records From Multiple Unbound Text Boxes

May 6, 2014

I have a form with 15 unbound text boxes (daily temperatures) and what I am trying to do after entering the temperatures into the text boxes the user clicks an add button which will add 15 new records into the temperature table

the code I have started off with is

Code:

CurrentDb.Execute "INSERT INTO ColdTemperatures (ProductID, ColdTempDate, Temperature) VALUES (" & Lettuce & ", #" & Me.RealTime & "#, " & Me.Lettuce & ")"

which adds 1 successfully however if i repeat the code above for all 15 this Im assumming will create a potential bottleneck and slow the system down

is it possible to add all 15 records at once? do you think Im going at this the right way

View 5 Replies View Related

Modules & VBA :: Linking Tables By Auto Inserting A Record Using Current Record

Aug 19, 2013

I have two forms both with separate tables

(1) Register and
(2) Payments.

One of the common denominators between them is the URN which is auto-populated as it is an auto number field. My issue is that when I want to add a new record to the payments table using the forms (I can get to the payments form via the register form), I want to be able to identify the record that I am currently viewing within the register and auto populate the URN field with the same number. This is what I have done so far,

Option Compare Database
Option Explicit
Private Sub AttachPaymentDetails()
Call PerformInsert("tblFinancialBudget", "frmFinancialBudget")
End Sub

[code]....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved