Automatically Copy Data From One Field In A Table To Other Related Fields In Other Tables

Aug 7, 2014

I'm trying to create a system where if I enter data into one field it will automatically appear in the corresponding field in another table. For instance if I enter the values 10,12,15 into a field called QID in table A I would like this to appear automatically in a field called QID in table B. Both tables are related and I have enforced referential integrity and 'cascade' options but this still doesn't seem to allow one table to automatically update another. My ultimate aim would be to have a form that you filled in data for the field QID once that then propagated to both Table A and Table B.

View Replies


ADVERTISEMENT

Automatically Fill Fields With Related Data

Nov 30, 2005

Hi!
I have a table with several fields. I would like to have a lookup in one field (combo list - get data from another table field) and for 2 other related field have the coressponding data appear automatically according to the selection in the lookup field.

eg.
Table1
|Field1...................|Field2...............|F ield3...............|
|LookupField1Table2 |AutoField2Table2|AutoField3Table2|

Table2
Field1...|Field2... |Field3...|
Data1...|Data2...|Data3...|

I am not quite sure if my question is clear... I had trouble in describing it in my post...

View 2 Replies View Related

Automatically Filling Linking Fields For New Rows In Related Table?

Dec 18, 2012

OK, so I have a database with four tables (Well, more than that, but these are the relevant ones). It's to be used for recording the results of site inspections.

"Tbl_Typicals" is a list of products. We'll call its key "Typical_ID".
"Tbl_Actions" is a list of tests performed on each product. A given product may have many tests, but each test applies to only one product. Its key is "Action_ID". Each row contains a Typical_ID to link on.
"Tbl_PlantComponents" records which products are installed on which site. Its key is "Component_ID". Each row contains a Typical_ID to link on.

The fourth table ("Tbl_Results") contains the results of each test. As a result of the relationships above, each row is specific to a single Action which applies to a particular PlantComponent, which is to say, each row has both a Component_ID and an Action_ID to link on.

So, what I need is a query that pulls all of these together, such that I can use these details as the line items of a subform.

The main form displays the details of the PlantComponent, which is a simple query to relate line items in Tbl_PlantComponents with the data about that particular product in Tbl_Typicals. So far, so easy.

The subform shows the details of each test applicable to that product. It then has toggle buttons and a comment field to indicate the results of the test, the results of which should be stored as a line item in Tbl_Results.

The "easy" way is to use an append query to generate Tbl_Results in advance. This works, but it raises a variety of new issues.

The nice way would be to use a normal SELECT query and have Access fill in the necessary linking fields (the Action_ID and Component_ID) on each row automatically. Now for trivial examples, this is very easy - my main form query manages just that: I created a link between Tbl_PlantComponents and Tbl_Comments (which stores general comments about each PlantComponent which aren't related to a specific test) based on the Component_ID and that works fine - when I edit the Comments field, the row is automatically created and the linked ID field filled in for me.

However, when I need to do it with 2 links, it all falls apart. I've tried everything I can think of, including generating a single-column unique ID to use for the link, but Access just won't autofill for me. It just makes those fields on the form (or in the datasheet view of the query) non-editable because there's no associated row in Tbl_Results. If I create a matching row in Tbl_Results the query works fine, but that's not the point.

Implementation of the query is non-trivial because it requires two outer joins involving 3 tables - All from Tbl_Actions to matching in Tbl_Results, and All from Tbl_PlantComponents to matching in Tbl_Actions. This necessiates splitting the query into two - the first relates Tbl_PlantComponents, Tbl_Typicals and Tbl_Actions (returning one row for each Action for every Component), and the second performs a single outer join (using an AND) between the first query and Tbl_Results.

View 5 Replies View Related

Queries :: Adding Fields In A Table That Are Related To Other Tables

May 13, 2013

I am a beginner in access and I want to populate a new field (REPUN_1 which corresponds to SEGMT_ID in the other table) in my table and this field is coming from another table. The values of the fields need to correspond to the row of my actual table (JMTable) having the same CO_ID, MOVEPLANCD and TTY_NO as the table I want to extract the values from (DI_Treaty_Crosswalk).

Here is my query:

UPDATE JMTable SET [REPUN_1] = DI_Treaty_Crosswalk.SEGMT_ID WHERE JMTable.TTY_NO = DI_Treaty_Crosswalk.TTY_NO AND JMTable.CO_ID = DI_Treaty_Crosswalk.CO_ID AND JMTable.MOVEPLANCD = DI_Treaty_Crosswalk.MOVE_PLAN_CD

and it doesn't work since access ask me to enter a parameter value.

View 1 Replies View Related

Tables :: Extract Data From Memo Field And Put Into Separate Fields Of New Table

Jun 15, 2014

I have a notes field in the customer table that is a memo field. An example of one customer's notes field data :

<div>20.3.14 Ordered 2 cartons</div>
<div>4.3.14 Ordered 2 cartons</div>
<div>18.2.14 ordered 1 carton</div>
<div>30.1.14 ordered 3 cartons SCENTED wipes</div>

[Code] ....

I want to extract the date to append to a date field in a "Calls" table and the comment into a text field in the "Calls" table. Is there a way I can do this via query or code?

View 2 Replies View Related

Forms :: Copy Certain Fields To Another Field In Same Table

Sep 8, 2013

I am using MS Access 2010 and I am trying to figure out how to copy a field(s) to another like record. For example I have simple split-form that contains detail items purchased (product number, item purchased, cost, etc). I have a check box call "chkApproved" and date box called "Approved Date". The user have a choice to select the invoice number, once selected the invoice number (there maybe anywhere from one or 2 to 4 rows based from the same invoice number).

The manager will go to the first record and check the "chkApproved" and date is automatically updated as today's date (Approved Date). This is fine if there is only one row, but when you have the same invoice number with 2 to 4 rows the user has to go to each row and check the box. I want to somehow automatically populate the rest of the rows within the same invoice number I don't need to create a new record only updating the existing records.

View 2 Replies View Related

Tables :: Change Field Data Automatically?

Feb 24, 2014

I have a table named days contains two columns (Day_Number, Day_Number_text)

and another table named information contains many column two of them is (Day_Number, Day_Number_Text)

so what i want to do when day_number = 1 for example so day_number_text = Frist automatically

View 7 Replies View Related

Tables :: Cannot Copy Data In Table

Apr 16, 2013

For some reason, I am unable to copy the data in a table using the square at the top left of the table: (See Pic)

View 2 Replies View Related

Tables :: Add Data Automatically In Table

Jun 25, 2013

I am working with a table where I want to be able to add choose the customer name from a dropdown and have the customer number automatically populate. I set up the dropdown already using the query builder for customer name and it works perfectly. I also chose customer number in the query, but it does not show.

Even better, in case of duplicate names, I would like to be able to select the customer number and have the name populate.

So ultimately, when I select either field, I want the other to auto populate...

View 10 Replies View Related

Tables :: Binary Data Copy To Other Table?

May 10, 2014

i want to copy binary data to another table with same structure.

how can i do this.

View 4 Replies View Related

Automatically Fill A Table From Data In Other Tables

Mar 20, 2006

I have 3 tables:

Student Info:
Student ID (Primary Key)
Name etc.

Assignment Info:
Assignment ID (Primary Key)
Assignment Number
Criteria Number

Grades:
ID (Primary Key)
Student ID - Linked to [Student ID]
Assignment ID
Criteria Number
Grade

What I would like to do is be able to link the tables in such a way that for each student entered in the Student Info table, entries are automatically entered into the grades table for each assignment criteria.

For example:
Assignment 1 has criteria 1.1, 6.3, 7.2, Assignment 2 has 4.2, 3.3

When John Smith is entered in student info, the grades table is automatically updated with 5 new entries in the form:

John Smith - 1 - 1.1 - Enter Grade
John Smith - 1 - 6.3 - Enter Grade
John Smith - 1 - 7.2 - Enter Grade
John Smith - 2 - 4.2 - Enter Grade
John Smith - 2 - 3.3 - Enter Grade

That way I can have a form that automatically shows the possible criteria for each assignment on the sub form for each available student without having to type it in each time.

Your help would be wonderful

View 2 Replies View Related

Automatically Copy Data Into A Subdatasheet

May 9, 2006

Please forgive me if this has already been explained...but I've searched and searched and haven't found anything like it...

I have a form which contains a command button to open another form which is attached to a subdatasheet in Microsoft Access 2002. When I click on the button to open the sub form, I would like for it to automatically copy the contents of a text box on the original form to a text box on the sub form.

Any help you could offer would be appreciated.

- Taylor

View 2 Replies View Related

Tables :: Possible To Automatically Lookup Data In A Table Without A Query?

Jun 18, 2013

A field in a table can be populated by a lookup up but it has to be done manually or with a form.A "new" table can be created with a query that matches the data.

Is it possible to skip these steps and create a field that automatically populates with the data from another table based on other common data?I can do this in Excel but not sure it can be done in Access.

View 1 Replies View Related

Copy Data From One Field To Another In Same Table

Apr 27, 2005

I have a field called Shipdate. I have created a new field that is called invoicedate. What I want to do is copy all of the shipdates and paste them in the invoicedate field for my old records. From here on out they would be distinct fields but for old records and reporting purposes I need those dates.

Can I do that in a query, do I need a module???

It's probably easier than I think it is.

Thanks.

View 2 Replies View Related

Would Like Field To Automatically Pull Data From Other Table

Apr 28, 2006

Hello Everyone,

I am having trouble with our receiving database. This database consists of two tables. One for vendors, which basically contains their vendor ID as well as vendor name and phone # etc. The other table is our receiving data table. When our receiving person receives product in, they log this in the receiving table including info such as date, autonumber for record, vendor etc. The problem is, when the person selects the vendor id, which is set up as a lookup field, we would like to have the vendor name pop up atuomatically within that record. I cannot for the life of me figure out why this isn't happening. The person is using a form to enter all of this data and runs a summary report at the end of the day. Our accounting dept. is requesting this info be added, but I cannot seem to figure it out.
Thanks so much for any assistance!
Amy (monet1369);)

View 6 Replies View Related

Tables :: How To Remove HTML Tags Displayed In Table When Copy / Paste Data

Jan 19, 2015

When I copy data from Outlook or MS Word that contains bullets or other HTML formatted text, into MS Access text control, the HTML tags are displayed in the tables.

The memo field in the table is set to Rich Text and so is the text control on the form.

Below is an example of the data I'm copying from Outlook email:

Fire Alarm Activation

Actual/Smoke Present
False
Planned Drill/Testing
Evacuation

2. Utilities/Power/Communication Failure

Now, below is what it looks like in my table or output in a report:

<ol>
<ol>
<li><strong>Fire Alarm Activation </strong></li>
</ol>
</ol>
<ul>

[Code] ....

How can I copy and paste and remove the html tags?

View 1 Replies View Related

Modules & VBA :: Copy Data From Excel Sheet To Access Table And Then Compare Two Tables

Dec 2, 2014

I have a form where when the user clicks on the browse button then excel workbook filepath gets stored in the textbox as below:

Code:
Private Sub CommandButton1_Click()
ChooseFile
End Sub
Sub ChooseFile()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)

[Code] .....

Please see attached the excel workbook. Everytime the user will select Excel workbook using Browse button. Now in that file , the first sheetname will always be "Summary". I want to perform the following steps:

1. So now I want VBA code to copy the data from columns "Withdrawn","Obsolete","Updated","LitRef" from Summary sheet to the Access table named tblSummary.

2. When the data gets copied in Access table then write So VBA code that will check if the data in field LitRef in table "tblSummary" is present in field "Reference" of Access table "tblliterature" . if its present then check in the tblSummary , which corresponding fields out of "Withdrawn","Obsolete" and "Updated" stores "Y" .
3. If "Withdrawn" field value is "Y" then change the status of corresponding record of tblliteraure to "Withdrawn"
4. If "Obsolete" field value is "Y" then change the status of corresponding record of tblliteraure to "Obsolete"
5. If "Updated" field value is "Y" then change the status of corresponding record of tblliteraure to "Updated" .

View 14 Replies View Related

Accessing Related Tables In Calc Fields

Apr 23, 2014

How do I use fields in related tables to create a calc field? The wizard only shows me the current table's fields. Can I do create me desired field by manually creating the calculation and bypassing the wizard? Or is this another restriction of Access?

View 1 Replies View Related

Moving Data From 2 Related Tables To 2 New Tables As An Archive

Apr 3, 2007

I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.

Private Sub Command26_Click()
On Error GoTo Err_Archive_Primary_Click

Dim strSQL As String
Dim strSQL2 As String

strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _
"VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _
"#" & Me.cboAreaDetailDate.Column(2) & "#)"

CurrentDb.Execute strSQL, dbFailOnError

'strSQL2 = "INSERT INTO ARC_289325045 (RecordID, UnitID, UserName, [TimeStamp], [Survey Point - Area], Measurement, NewArea, [EXIT Form] ) " & _
'"SELECT FORM_ID_289325045.RecordID, FORM_ID_289325045.UnitID, FORM_ID_289325045.UserName, FORM_ID_289325045.TimeStamp, FORM_ID_289325045.[Survey Point - Area], FORM_ID_289325045.Measurement, FORM_ID_289325045.NewArea, FORM_ID_289325045.[EXIT Form] " & _
'"FROM FORM_ID_289325045"

'CurrentDb.Execute strSQL2, dbFailOnError



Exit_Archive_Primary_Click:
Exit Sub

Err_Archive_Primary_Click:
MsgBox Err.Description
Resume Exit_Archive_Primary_Click

End Sub


The next step is to do the same for the child table and append related records to the child archive table.

View 4 Replies View Related

Moving Data From 2 Related Tables To 2 New Tables As An Archive

Apr 3, 2007

I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.

Private Sub Command26_Click()
On Error GoTo Err_Archive_Primary_Click

Dim strSQL As String
Dim strSQL2 As String

strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _
"VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _
"#" & Me.cboAreaDetailDate.Column(2) & "#)"

CurrentDb.Execute strSQL, dbFailOnError

'strSQL2 = "INSERT INTO ARC_289325045 (RecordID, UnitID, UserName, [TimeStamp], [Survey Point - Area], Measurement, NewArea, [EXIT Form] ) " & _
'"SELECT FORM_ID_289325045.RecordID, FORM_ID_289325045.UnitID, FORM_ID_289325045.UserName, FORM_ID_289325045.TimeStamp, FORM_ID_289325045.[Survey Point - Area], FORM_ID_289325045.Measurement, FORM_ID_289325045.NewArea, FORM_ID_289325045.[EXIT Form] " & _
'"FROM FORM_ID_289325045"

'CurrentDb.Execute strSQL2, dbFailOnError



Exit_Archive_Primary_Click:
Exit Sub

Err_Archive_Primary_Click:
MsgBox Err.Description
Resume Exit_Archive_Primary_Click

End Sub


The next step is to do the same for the child table and append related records to the child archive table.
Edit/Delete Message Reply With Quote Quick reply to this message
JJKramer
View Public Profile
Send a private message to JJKramer
Find all posts by JJKramer
Add JJKramer to Your Buddy List
Sponsored Links

View 1 Replies View Related

Related Table Fields

Mar 13, 2008

Greetings to everyone,

I'm building a database which will generate work orders, and those have a opening date and closing date, besides that it has a work order number that is of the following format:

YYYY/ NNN (being the NNN the work order number in that year)

to create the number of the work order I'm trying to fill the WOYear field
with the year of the WODate field...but I'm not being able to do it...
How should I do it?

Thanks.

View 5 Replies View Related

Tables :: Update Data In Related Tables?

Oct 22, 2014

I have to make a Costing System but for that I need to enter our Expense details in database according to Fiscal year and months.

I need a table for Fixed expenses and one for Variable Expenses and then I need one or more Forms to update data in those tables. Now I've created a table with Fixed Expenses. I have to update Year and Amount in that. Now it is only letting me one entry per Expense.

I want multiple entries for one Expense say 'Advertising' for different years. I'm thinking may be I need to make more than one Table, may be one for Expenses with ExpenseID and other for Years with Year and YearID and the third one for Amount with columns Amount, Method of Payment, Date and Notes. I did tried this but I think I'm not creating proper relation may be because its only updating for one year.

I'm using Access 2003.

View 2 Replies View Related

Tables :: Saving Data To Related Tables?

Sep 27, 2012

I have a built a database to record and collate info about clinical trials that are run within my department. I have one large table [Trial Info] which contains all trial info and have created a second and third table [Milestones] & [Comments] to collect dates of various milestones and a notes that occur throughout the course of a study.

The milestones (dates) are recorded in the 2nd table and the comments are recorded in the 3rd table.

All data is entered by staff on forms. The first form captures basic info about the study, once this has been entered, the idea is to click a button to open the second form to document the trial milestones, this form also contains a subform for listing any free text comments required during the life of the study which are stored in the 3rd table.

I have setup the relationships between tables as best I can.

The main table with basic trial info is the parent table, linking the primary key to the foreign key in the second table, the foreign key of the third table is related to the primary key in the second table so these tables should be looking up the correct clinical trial as far as I can tell.

The form containing data from the main table has a button which I have set to open the Milestones & Comments form, and I have set this to open to the record that relates to the record in view in the primary form. The primary key is related to the foreign look-up key in the milestones table.

This opens the form fine, however this is not updating the foreign look-up key, this remains '0' which I assume is the cause of the following error when I try to save changes to the record

Quote:

You cannot add or change a record because a related record is require in table 'Trial Info'

How do I trigger the foreign key to update to the primary key so that the first time a milestone page is opened for a new study it creates a matching record?

View 4 Replies View Related

Use One Form To Add Data To Two Related Tables

Jul 24, 2006

I need help. I am not sure if this is a form issue or a logic issue i have a db for tracking students the classes they take and their notetakers for classes. Each class is most likely unique to each student but sometime there are multiple students in each class that need a notetaker and there should only be one notetaker per class. I have 3 tables and they are all linked through a unique iD called CRN (number).

I am looking for a way to add a student to a class and create a class at the same time in one form. I am trying to limit the redunancy by adding a class each time and then adding a student to the class.

Any suggestions would be great. I have gone through 10+ redesign and am just at a loss on how to accomplish this.

View 1 Replies View Related

Can Related Tables Have Same Field?

Sep 2, 2007

In a case where two tables are related, can the field names which relate them be the same? Or is it necessary to use different field names?

Robert

View 4 Replies View Related

Insert Data In Two Related Tables Simultaneously

Dec 11, 2004

I want to insert a huge number of data (Customer and their adress) into 2 related tables in Access. Each table in access is related by some kind of ID (Autonumber-Primary key). The first table is CUSTOMER , the other one is CUSTOMER_ADRESS . Access relate each Customer to his Adress, so if I import data into one table and then import data into another table how would the database know that all the data pertains to the same person. How to insert the new list of customer and adress without using a form?
Thanks for your help.

View 6 Replies View Related







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