Can't Add Records To Tables

Mar 20, 2013

I have a patients databasein which i have a patients table that is connected with 4 other tables via PID (one to many).I the have a form in which i select my patient, and i have 4 individual buttons for 4 other pop up forms to enter or edit the information based on which patient i select.The problem is that whenever i add a record i get an error that i have a record related in my main Patients table. I am attaching the file.mydb.zip The problem comes through my main form.

View Replies


ADVERTISEMENT

Tables :: Linking Records In One Table To Multiple Records In Another And Assign Percentage?

Nov 21, 2012

I have a table (tbl Team Info) which contains names and codes for teams within my business (>400 records) and another table (tbl Process) which contains a list of high level tasks (30 records).

I need to create something where for each team name 9in tbl Team Info) I can map them to the tasks that they undertake (in tbl Process) and assign a percentage of time then spend on each task. Each team could map to several different tasks.

View 3 Replies View Related

Tables :: How To Combine Records Of Three Tables Into One Table

Jul 30, 2013

I have three tables. I want to combine all the records in these tables into one table. I need VBA code to do this. The first table is called down1, the second table is called down2 and the third table is called down3. All these tables contain the same fields so I don't think combining them will be a problem.

View 3 Replies View Related

Tables :: Deleting Matching Records From Two Tables

Dec 5, 2012

I have two tables "Master List" and "Audit". I want to delete the records from the "Master" that match those in the "Audit". I am using Access 2010 and have used it often but have built very few queries.

View 3 Replies View Related

Tables :: Create Tables From Records In Field?

Sep 5, 2013

I'm trying to create a table for every record I have in a field. I have two tables, one titled "Experiments" and another titled "Students". I want the new tables generated from the field EXP_NAME from Experiments. I need it to have seven fields, one copied from Students, five labeled Trial1 thru Trial5, and a final for a grade.

View 10 Replies View Related

Tables :: Deleted Records In One-to-one Tables

Apr 25, 2014

My db includes two tables, Employees and Users, both with a pk of EmpNum (Autonumber in Employees; Number in Users). Users is a subset of Employees, and in the Users table, the row source for EmpNum is a query of the Employees table. I had a relationship defined with a one-to-one between the two tables, but did not have Enforce Referential Integrity or Cascade selected.

The problem is, I deleted a record out of Users, but it also automatically deleted the related Employees record. Re-creating the employee was quite the task because all related records in several other tables also disappeared. I experimented by deleting the relationship between the two tables and then deleting another user, but it still deleted the related employee. How can this be? The two tables are no longer linked, other than the Users EmpNum lookup.

View 6 Replies View Related

Tables :: Moving Records Between Tables?

May 7, 2014

I have been tasked with creating a simple database for work.

Basically the table tracks the progress of various employment checks. So example headings are Name, CRB, Occupational Health etc. Now basically, once all the checks are completed, I need the record to be moved to another table named 'Live'.

Is there any easy way to achieve this, or will i have to manually move each record once the checks have been completed.

View 3 Replies View Related

Copying A Set Of Records Across Several Tables To Same Tables With A Few Changes

Apr 8, 2015

There is one main policy table, and a collection of related tables that store information associated with each of the policies (coverage amounts, agents, etc). What I'm struggling with though is where they renew every so often (most times it's each year, but some go three or more years). Because I need the database to show everything EXACTLY as it was on each policy term, even expired ones, I don't want to just edit the existing records when policies renew; I need to create a copy of the ENTIRE record (across all related tables), but with a new PK, and the ability for users to change a few items, such as the policy number and effective dates.

There are two keys that I use to identify policies: one is the PK, which is an auto# that will need to change, and the other is a small text ID set when the policy is first issued, in order to make sure that even when policy numbers change from year to year, we can always track the history, so of course that one will need to remain the same. If I have the user click a "Renew" button on the policy view form that goes to a small form that takes what changes I want to allow and converts those into variables, could I then use those variables in a query, and have it copy all of these related records, with the other tables taking the new PK from the main table to keep the overall policy record linked?

View 4 Replies View Related

Records In Tables

Apr 19, 2005

Is there a way that you can take information from multiple forms to create one record in a table?

View 1 Replies View Related

Tables :: Can't Add New Records

Dec 26, 2012

Im having a problem with access 2010. I created a new database and created the relationships.However when i tried to create a form i noticed im not able to add any new records to my tables. Even if i don't use the form but directly on the tables the option for new record is greyed out.

View 5 Replies View Related

Move Records Between Tables

Nov 22, 2005

hiya, im new to this sql scene..!

i have an MS Access db containing a few tables of 'calls recorded' and 'finished calls'.

(i want to move all 'Finished calls' to a seperate 'Finished Calls' table)

anyway, the thing i want to do is to move records from Table1 to Table2, i am able to do this using the following code...

SELECT * INTO Table2
FROM Table1
WHERE Finished='Yes';

this code does work, however it does not delete the records that were moved out of Table1 - they are still there, its more or less copying and pasting them..

any help would be much appreciated!

View 14 Replies View Related

Archiving Records From Two Tables

Nov 24, 2006

I have a database for tracking tasks. each task may have associated documents for it which are kept in a separate table.

I have an archiving procedure which takes closed or completed tasks (from the main table) and appends them to an archive table but it leaves the associated documents in the second table, or if I enforce integrity it will delete them.

Anyone have a suggestion on how i can archive records from two tables at the same time I include the archive code for your information....

Many Thanks as always for your help and assistance

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''
' procedure archives closed or complete records to archive table and then '
' Deletes original records from source table '
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''

On Error GoTo Err_btnArchiveAdhoc_Click

Dim strMySql As String, strResponse As String, intRecordCount As Integer

Dim cnn As ADODB.Connection
Dim rstTemp As ADODB.Recordset

strResponse = MsgBox("By clicking Yes you will Archive any closed or" & _
vbCrLf & "completed tasks and delete the original records from the table", vbExclamation + vbYesNo, gstrAppTitle)
If strResponse = vbNo Then
Exit Sub
Else
Set cnn = CurrentProject.Connection
Set rstTemp = New ADODB.Recordset

' builds sql string to append closed or complete records from the original table into archive table
strMySql = "INSERT INTO tblArchiveAdHocTasks ( Seq_Number, Item_Type, TaskTitle, Task_Description, TaskActions, StartDate, TgtDate, ReviewDate, TaskLead, Status, LastUpdatedBy, estHours, Progress, PersIDAssocPerson1, PersIDAssocPerson2, PersIDAssocPerson3, PersIDAssocPerson4, PersIDAssocPerson5 )"
strMySql = strMySql + " SELECT tblAdHocTask.Seq_Number, tblAdHocTask.Item_Type, tblAdHocTask.TaskTitle, tblAdHocTask.Task_Description, tblAdHocTask.TaskActions, tblAdHocTask.StartDate, tblAdHocTask.TgtDate, tblAdHocTask.ReviewDate, tblAdHocTask.TaskLead, tblAdHocTask.Status, tblAdHocTask.LastUpdatedBy, tblAdHocTask.estHours, tblAdHocTask.Progress, tblAdHocTask.PersIDAssocPerson1, tblAdHocTask.PersIDAssocPerson2, tblAdHocTask.PersIDAssocPerson3, tblAdHocTask.PersIDAssocPerson4, tblAdHocTask.PersIDAssocPerson5"
strMySql = strMySql + " FROM tblAdHocTask "
strMySql = strMySql + " WHERE (((tblAdHocTask.Status)=6 Or (tblAdHocTask.Status)=10))" ' status 6 is closed and 10 is complete
DoCmd.SetWarnings False

'DoCmd.RunSQL strMySql ' runs append query
rstTemp.CursorLocation = adUseClient
rstTemp.Open strMySql, cnn, adOpenDynamic, adLockOptimistic


DoCmd.SetWarnings True ' turn warnings back on
' deletes records that have been archived above
strMySql = "DELETE tblAdHocTask.Seq_Number, tblAdHocTask.Item_Type, tblAdHocTask.TaskTitle, tblAdHocTask.Task_Description, tblAdHocTask.TaskActions, tblAdHocTask.StartDate, tblAdHocTask.TgtDate, tblAdHocTask.ReviewDate, tblAdHocTask.TaskLead, tblAdHocTask.Status, tblAdHocTask.LastUpdatedBy, tblAdHocTask.estHours, tblAdHocTask.Progress, tblAdHocTask.PersIDAssocPerson1, tblAdHocTask.PersIDAssocPerson2, tblAdHocTask.PersIDAssocPerson3, tblAdHocTask.PersIDAssocPerson4, tblAdHocTask.PersIDAssocPerson5"
strMySql = strMySql + " FROM tblAdHocTask"
strMySql = strMySql + " WHERE (((tblAdHocTask.Status) = 6 Or (tblAdHocTask.Status) = 10))" ' status 6 is closed status 10 is complete
rstTemp.CursorLocation = adUseClient
rstTemp.Open strMySql, cnn, adOpenDynamic, adLockOptimistic

End If
MsgBox "Export Complete ", vbInformation, gstrAppTitle
Exit_btnArchiveAdhoc_Click:
Exit Sub

Err_btnArchiveAdhoc_Click:
If Err.Number = 2501 Then ' runtime error as user cancelled delete part of query
Exit Sub
End If

MsgBox "'Error" & Err.Number & "'" & vbCrLf & Err.Description

Resume Exit_btnArchiveAdhoc_Click

End Sub

View 6 Replies View Related

Find Records From 2 Tables

Jul 31, 2007

How would one go about comparing 2 tables and finding those records that are not common to both tables? For instance, I have a table that I suspect some records have been accidently deleted by the user. I would like to compare that table to an older version of the table, and list only those records that exist only in the older version of the table.
Thanks.

View 2 Replies View Related

Connecting Records From Two Different Tables

Apr 14, 2008

is there a possibility to connect two different databases??? I mean is, I have a table called PERSON. under PERSON, there are fields called PERSON NAME, BIRTHDAY and ADDRESS. another table is called SEMINARS, under it are DATES FROM, DATES TO and TITLE.

I want to combine one of the records in PERSON to the 5 records in the SEMINARS. is there a possibility to do that???

to include in the information, there are 10 records in the PERSON and there are 75 records in the SEMINARS. and I want to add more records in SEMINARS in any of the records in PERSON in the near future.

View 1 Replies View Related

A Query To Add Records Into 2 Tables

Dec 11, 2005

Hi all,

I'd like to know if it's possible, with MS Access to use a query that adds records from 2 tables into 2 other tables.

Thank by advance :)

Twinpath.

View 1 Replies View Related

Combining Records From 2 Tables

Jan 3, 2008

Hello all,

I have two MS Access tables; table1 contains installing records (fields = serial, installdate) and table2 contains de-installing records (fields = serial, deinstalldate). Tables are structured as followed:

Table1:
serialX installdate1
serialX installdate2
serialX installdate3

Table2:
serialX deinstalldate1
serialX deinstalldate2

I'd like to combine the above two tables to get:

Table3:
serialX installdate1 deinstalldate1
serialX installdate2 deinstalldate2
serialX installdate3 null

Is it possible? Right now, whenever I joined the two table on serialX I got 2 deinstalldate's for each installdate, e.g.:

serialX installdate1 deinstalldate1
serialX installdate1 deinstalldate2
serialX installdate2 deinstalldate1
serialX installdate2 deinstalldate2
..........

Thanks in advance for your time and help! I'd appreciate it!

Best regards,

Andy

View 6 Replies View Related

Can't Add New Records When Tables Are Joined

Apr 18, 2005

I have two tables in my database
Agents
Zip Codes (linked table)

If I create a query and then a form off the query that includes fields from both tables - Access will not let me add new records.

Ultimatley what I am looking to do is have a zip code field in the Agents table that I fill in and then it will automatically look at the zip codes table and then fill in the zip code, county, & state in a different area of the form.

I tried using fields from both tables and tried a query using fields from both tables and it will not let me add new records.
I have a relationship between the fields in both tables.

What am I doing wrong. I know this can be done.

Any help would be great!!!

View 2 Replies View Related

Tables :: How To Store Records

Mar 20, 2013

I have a table with with records that need to be captured for current and historical reporting. This is my table:

[Incident] [planned_end_date] [Report_Date}
1234 3/8/13 2/28/13
1234 3/8/13 3/1/13
1234 3/10/13 3/2/13

Then, on the next report dated 3/3/13 the incident may not be on the report because it is closed.

I need to be able to report on a count of incidents that meet different criteria at any point in time. I first made [Incident] and [planned_end_date] the PK but then when the [planned_end_date] changed it wouldn't be imported. If I have no PK all records will be imported and I would have the data I need but I think the table will grow too quickly (40 new records per day).

View 2 Replies View Related

Losing Records In Tables

Mar 19, 2012

My company had an Access db created back in 2002 in order to create file names (Legal Labeler). The db consists of many reference tables (Figure 1). The person who created the db created a form to use in order to create the file name and labels. As you can see there are various drop downs where the end user can choose which information to include. I do not think that the tables are linked. Once the end user fills in the form they click Save Label Data and the data is written to a master table (Table tblLevelOneSubject).

One of the problems we are having is that records in any one of the extraneous tables (Company Name, SubCatetory, SubCategories L1/L2, etc.) just disappear. For example, in Figure 3, we have all the entries for the drop down labeled SubCategory (A codes are depicted) but, for some reason, we are randomly missing some of the codes (typically all the A codes and B codes); however, nothing from the master table is missing (that is why I do not believe they are linked).

Another major issue we are running into is in the table named tblLevelFiveSubCatTwo (SubCategory L2 on the form) (Figure 4), which is an auto-numbered table, we are also losing records (as you can see it table starts at 7). When I created a file last week I needed to create a new entry in the drop down SubCategory L2 and it was auto-numbered 8 when it should have been 734. Also, the table shows that there are only 697 records but if we are auto-numbering there should be 734 records. Therefore, we are losing records in this table as well.

Is there any way we can secure the tables so this does not happen in the future? When I export the data into Excel it looks as though all of the data is accounted for - it is just missing in the reference tables.

View 4 Replies View Related

Adding Images Into Tables/Records

Jun 26, 2006

Hi there,

I'm trying to add an image into a table. I know I can do it manually by creating an OLE Object and so forth. I am actually trying to get the user to enter in the path of the image and add it into the record/table.

Basically this is for a database that will hold a scanned image of a certificate associated with each person entered into the database. Anyone have any suggestions?

Thanks

View 2 Replies View Related

Insert New Records In Ref Integrity Tables

Sep 6, 2006

Hi All,

I hope somebody can help me on this.

I still use Access 97.

I have 4 tables that contain a vehicle registration number field as their primary key and have one-to-one referential integrity applied.

I want to add a new registration to all 4 tables from one query. How?

I've tried many permutations with no success, such as putting the registration on a new table and trying to apply this to the 4 RI tables. I keep getting ref intergrity violations. Obviously I could disable the ref integrity rules, update the tables and then reapply the rules, but this is not possible if I am going to make the database available to a user group. A new registration needs to be added seamlessly. By not having ref integrity could leave the DB in an inconsistent state.

Help! If what I want is not directly possible, then any work-round would be appreciated.

Thanks in anticipation

Richard

View 2 Replies View Related

Finding Unique Records Between 2 Tables

May 12, 2006

Dear all,

Many thanks for taking the time to read this.

I have a slight problem which seems like it should be easy to solve but I have no idea how to do it.

I have 2 tables (table1 and table2 for instance) Table2 contains more data than table1 but should contain everything in table1 as well as more.

How is it possible to return just records that are in table2 that are not in table1

Eg

Table1 contains:

IDab
112
222
322
422
511
611
711

Table2 contains:

IDab
112
222
322
422
511
611
711
833

The query should return just the line:
833
as this is unique.

thanks again

View 6 Replies View Related

Count Of Records In All Tables In Database.

Aug 6, 2007

Is there a way to have a query pull all of the table names within a database and display the number of records in each table? The names, number of tables in the database, an number of records within each table will always be changing, which is why I wanted to use a Query to pull the information.

I have already tapped into the MSysObjects table to retrive the Table names (via a Query), I am however stumped on how I am going to display each tables record count. Any help would be appreciated. Thanks in advance.

View 1 Replies View Related

New Records On Multiple Tables With One Form

Jun 15, 2005

Hey Guys,

I have 2 tables (tblSET, tblPROJECT) that have a relationship between them in the form of strPROJID (Project ID)

I need to make a form that has all empty fields in it, and when filled in distributes the entered data to the corresponding field in the corresponding table. I have tried using the design wizard and just putting the fields from all tables onto one form, but the "new record" button is greyed out when I do that. I figure this will include coding of some sort but I am far from a coder.

Thanks ahead of time,

JVermast

View 1 Replies View Related

HELP! 2 Tables, Want To Show Dissimilar Records Only

Oct 12, 2004

Boy, I thought this would be easy! It's simple to show common records, but I can't seem to be able to withdraw uncommon records. They are the ones I want. I can do it the long way by bouncing one record against all the records of the other with an Iif statement, then creating another query that groups all those results (thousands) and eliminates the erroneous data by using a min or max statement as a filter. This results in very, very long calculation times. There has to be an easier way. Please help, because I'm goining to have to do this several levels deep, and it's bad at the first level already. Thanks in advance.

View 1 Replies View Related

2 Tables - VIEW Duplicate Records

Feb 3, 2005

I have 2 tables that have the same structure and same column names - Table A and TAble B. If field1, field2, field3, field4, and field5 match - I want to see that duplicates exist.

How do I do it with 2 tables? I know the query wizard check for duplicates can do it in one table - but I need to compare the two.

thanks.

View 1 Replies View Related







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